Skip to content

Instantly share code, notes, and snippets.

@gerad
Created May 4, 2015 21:00
Show Gist options
  • Save gerad/0e93a2357475621e7ecc to your computer and use it in GitHub Desktop.
Save gerad/0e93a2357475621e7ecc to your computer and use it in GitHub Desktop.
// publish `message` to the "/echo" topic, and call `callback` on response
module.exports = function echo(connection, message, callback) {
connection.subscribe('/echo', callback);
connection.publish('/echo', message);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment