Created
July 14, 2012 06:49
-
-
Save yocontra/3109758 to your computer and use it in GitHub Desktop.
example code
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
server = new Pulsar port: 4001 | |
schan = channel 'notify:operators' | |
schan.on 'newClient', -> | |
schan.emit 'updateUnanswered', 5 | |
client = new Pulsar.Client port: 4001 | |
cchan = client.channel 'notify:operators' | |
cchan.on 'updateUnanswered', (num) -> console.log 'unanswered:', num | |
### Javascript ver | |
var cchan, client, schan, server; | |
server = new Pulsar({ | |
port: 4001 | |
}); | |
schan = channel('notify:operators'); | |
schan.on('newClient', function() { | |
return schan.emit('updateUnanswered', 5); | |
}); | |
client = new Pulsar.Client({ | |
port: 4001 | |
}); | |
cchan = client.channel('notify:operators'); | |
cchan.on('updateUnanswered', function(num) { | |
return console.log('unanswered:', num); | |
}); | |
### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment