Skip to content

Instantly share code, notes, and snippets.

@darylteo
Created May 23, 2012 07:01
Show Gist options
  • Save darylteo/2773638 to your computer and use it in GitHub Desktop.
Save darylteo/2773638 to your computer and use it in GitHub Desktop.
EventBus Example
// Server
load('vertx.js');
var eb = vertx.eventBus;
eb.registerHandler('test.address', function(message){
stdout.println('Message Received: ' + message);
});
// Client
load('vertx.js');
var eb = vertx.eventBus;
vertx.setPeriodic(1000, function(id){
stdout.println('Sending Message');
eb.send('test.address', {
"hello" : "world"
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment