Skip to content

Instantly share code, notes, and snippets.

@kborchers
Created February 22, 2013 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kborchers/8a8c43a2f927357c467c to your computer and use it in GitHub Desktop.
Save kborchers/8a8c43a2f927357c467c to your computer and use it in GitHub Desktop.
// Initialization
// by providing channels, subscription could be automatic
var notifiers = AeroGear.Notifier([
{
type: "vertx",
name: "appNotifications",
settings: {
connectURL: "someURL",
channels: [
{
name: "channel1",
callback: function(){}
},
{
name: "channel2",
callback: function(){}
}
]
}
},
{
type: "atmosphere",
name: "stockTicker",
settings: {
connectURL: "someURL",
channels: [
{
name: "channel1",
callback: function(){}
}
]
}
}
]).clients; // Or what ever name we want to call these
// Usage
notifiers.appNotifications.channel1.publish( messageObject );
notifiers.stockTicker.channel1.unsubscribe();
...
@matzew
Copy link

matzew commented Feb 22, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment