lib/services/bus.js
function publish(topic, msg) {
  if (!topic || !msg || typeof topic !== 'string' || typeof msg !== 'object') {
    throw new Error('A `topic` (string) and `msg` (object) property must be defined');
  }

  if (module.exports.client && BUS_MODULE) {
    module.exports.client.publish(`${NAMESPACE}:${topic}`, msg);
  } else if (module.exports.client) {
    module.exports.client.publish(`${NAMESPACE}:${topic}`, JSON.stringify(msg));
  }
}
function publish(topic, msg) {
  if (!topic || !msg || typeof topic !== 'string' || typeof msg !== 'object') {
    throw new Error('A `topic` (string) and `msg` (object) property must be defined');
  }

  if (module.exports.client && BUS_MODULE) {
    module.exports.client.publish(`${NAMESPACE}:${topic}`, msg);
  } else if (module.exports.client) {
    module.exports.client.publish(`${NAMESPACE}:${topic}`, JSON.stringify(msg));
  }
}
function publish ( topic , msg ) { if ( ! topic || ! msg || typeof topic !== 'string' || typeof msg !== 'object' ) { throw new Error ( 'A `topic` (string) and `msg` (object) property must be defined' ) ; } if ( module . exports . client && BUS_MODULE ) { module . exports . client . publish ( ` ${ NAMESPACE } ${ topic } ` , msg ) ; } else if ( module . exports . client ) { module . exports . client . publish ( ` ${ NAMESPACE } ${ topic } ` , JSON . stringify ( msg ) ) ; } }
Publish a message to the bus.

@param  {String} topic
@param  {String} msg
Publish a message to the bus .