lib/rpc-client/client.js
function(client, msg, serverType, serverId, cb) {
  if (typeof serverId !== 'string') {
    logger.error('[omelo-rpc] serverId is not a string : %s', serverId);
    return;
  }
  if (serverId === '*') {
    let servers = client._routeContext.getServersByType(serverType);
    if (!servers) {
      logger.error('[omelo-rpc] serverType %s servers not exist', serverType);
      return;
    }

    async.each(servers, function(server, next) {
      let serverId = server['id'];
      client.rpcInvoke(serverId, msg, function(err) {
        next(err);
      });
    }, cb);
  } else {
    client.rpcInvoke(serverId, msg, cb);
  }
}
function(client, msg, serverType, serverId, cb) {
  if (typeof serverId !== 'string') {
    logger.error('[omelo-rpc] serverId is not a string : %s', serverId);
    return;
  }
  if (serverId === '*') {
    let servers = client._routeContext.getServersByType(serverType);
    if (!servers) {
      logger.error('[omelo-rpc] serverType %s servers not exist', serverType);
      return;
    }

    async.each(servers, function(server, next) {
      let serverId = server['id'];
      client.rpcInvoke(serverId, msg, function(err) {
        next(err);
      });
    }, cb);
  } else {
    client.rpcInvoke(serverId, msg, cb);
  }
}
function ( client , msg , serverType , serverId , cb ) { if ( typeof serverId !== 'string' ) { logger . error ( '[omelo-rpc] serverId is not a string : %s' , serverId ) ; return ; } if ( serverId === '*' ) { let servers = client . _routeContext . getServersByType ( serverType ) ; if ( ! servers ) { logger . error ( '[omelo-rpc] serverType %s servers not exist' , serverType ) ; return ; } async . each ( servers , function ( server , next ) { let serverId = server [ 'id' ] ; client . rpcInvoke ( serverId , msg , function ( err ) { next ( err ) ; } ) ; } , cb ) ; } else { client . rpcInvoke ( serverId , msg , cb ) ; } }
Rpc to specified server id or servers.

@param client     {Object} current client instance.
@param msg        {Object} rpc message.
@param serverType {String} remote server type.
@param serverId   {Object} mailbox init context parameter.

@api private
Rpc to specified server id or servers .