Skip to content

Instantly share code, notes, and snippets.

@yankov
Created May 22, 2012 05:46
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 yankov/2766891 to your computer and use it in GitHub Desktop.
Save yankov/2766891 to your computer and use it in GitHub Desktop.
<script type='text/javascript' src='http://cdn.sockjs.org/sockjs-0.1.min.js'></script>
<script type='text/javascript' src='vertxbus.js'></script>
<script type="text/javascript">
var eb = null;
window.onload = function() {
eb = new vertx.EventBus("http://localhost:8080/eventbus");
eb.onopen = function() {
console.log('connected');
eb.registerHandler('some-address', function(message) {
console.log('received a message: ' + JSON.stringify(message));
});
eb.send('some-address', {name: 'tim', age: 587});
};
eb.onclose = function() {
console.log("Not connected");
};
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment