Created
June 19, 2013 13:39
-
-
Save lholmquist/5814405 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a notifier with the vertx apadter | |
notifierVertx2 = AeroGear.Notifier({ | |
name: "client2", | |
settings: { | |
autoConnect: true, | |
connectURL: window.location.protocol + '//' + window.location.hostname + ':' + window.location.port + "/eventbus", | |
onConnect: function() { | |
console.log( "connected" ); | |
}, | |
onConnectError: function() { | |
console.log( "connection error" ); | |
}, | |
onDisconnect: function() { | |
console.log( "Disconnected" ); | |
}, | |
channels: [ channelObject ] | |
} | |
}); | |
// Create a notifier with stompws adapter | |
notifierStomp = AeroGear.Notifier({ | |
name: "stompClient", | |
type: "stompws", | |
settings: { | |
onConnect: function() { | |
console.log( "connected" ); | |
}, | |
onConnectError: function( event ) { | |
console.log( "connection error", event ); | |
}, | |
onDisconnect: function() { | |
console.log( "Disconnected" ); | |
}, | |
connectURL: "ws://localhost:61614/stomp", | |
channels: [ stompChannel ] | |
} | |
}); | |
// When the stompws notifier is created this way, the onXXX methods are actually ignored and there is no autoConnect | |
// you would need to pass these onXXX methods when calling connect | |
// These should be easy fixes to get these 2 adapters in line | |
// Just wanted to see what others though |
the sentence i wrote is a little confusing.
the onXXX methods are ignored on the stompws adapter and need to be specified when calling connect. If we add a autoConnect, then we need to make sure they are not ignored
The vertx adapter will not ignore those methods, even if calling autoConnect === true, they can also be overridden in the connect methods is you feel like it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So, with an
autoConnect
these onXXX functions would not be ignored, in the way they are alined above ?