Skip to content

Commit

Permalink
Notifier:vertx - Add send method. Fixes AGJS-50
Browse files Browse the repository at this point in the history
  • Loading branch information
kborchers committed Jul 9, 2013
1 parent a20ea67 commit 2023fb5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/notifier/adapters/vertx.js
Expand Up @@ -404,4 +404,27 @@
}
};

/**
Send a message to a particular channel
@param {String} channel - the channel to which to send the message
@param {String|Object} [message=""] - the message object to send
@example
// Send an empty message to a channel
notifier.clients.client1.send( "test.address" );
// Send a "Hello" message to a channel
notifier.clients.client1.send( "test.address", "Hello" );
// Send a "Hello" message as an object
notifier.clients.client1.send( "test.address", { "message": "Hello" } );
*/
AeroGear.Notifier.adapters.vertx.prototype.send = function( channel, message ) {
var bus = this.getBus();

message = message || "";

bus.send( channel, message );
};

})( AeroGear, vertx );

0 comments on commit 2023fb5

Please sign in to comment.