src/mocker/rtm.js
function sendToClient (message, client) {
  return new Promise((resolve, reject) => {
    try {
      client.send(JSON.stringify(message), (e) => {
        if (e) {
          logger.error(`could not send rtm message to client`, e)
          return reject(e)
        }
      })
    } catch (e) {
      logger.error(`could not send rtm message to client`, e)
      return reject(e)
    }

    resolve()
  })
}
function sendToClient (message, client) {
  return new Promise((resolve, reject) => {
    try {
      client.send(JSON.stringify(message), (e) => {
        if (e) {
          logger.error(`could not send rtm message to client`, e)
          return reject(e)
        }
      })
    } catch (e) {
      logger.error(`could not send rtm message to client`, e)
      return reject(e)
    }

    resolve()
  })
}
function sendToClient ( message , client ) { return new Promise ( ( resolve , reject ) => { try { client . send ( JSON . stringify ( message ) , ( e ) => { if ( e ) { logger . error ( ` ` , e ) return reject ( e ) } } ) } catch ( e ) { logger . error ( ` ` , e ) return reject ( e ) } resolve ( ) } ) }
sends the given message to the given client
sends the given message to the given client