Skip to content

Instantly share code, notes, and snippets.

@yocontra
Created July 14, 2012 06:49
Show Gist options
  • Save yocontra/3109758 to your computer and use it in GitHub Desktop.
Save yocontra/3109758 to your computer and use it in GitHub Desktop.
example code
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