lib/services.js
function Client(svc, opts) {
  opts = opts || {};
  events.EventEmitter.call(this);

  // We have to suffix all client properties to be safe, since the message
  // names aren't prefixed with clients (unlike servers).
  this._svc$ = svc;
  this._channels$ = []; // Active channels.
  this._fns$ = []; // Middleware functions.

  this._buffering$ = !!opts.buffering;
  this._cache$ = opts.cache || {}; // For backwards compatibility.
  this._policy$ = opts.channelPolicy;
  this._strict$ = !!opts.strictTypes;
  this._timeout$ = utils.getOption(opts, 'timeout', 10000);

  if (opts.remoteProtocols) {
    insertRemoteProtocols(this._cache$, opts.remoteProtocols, svc, true);
  }

  this._svc$.messages.forEach(function (msg) {
    this[msg.name] = this._createMessageHandler$(msg);
  }, this);
}
function Client(svc, opts) {
  opts = opts || {};
  events.EventEmitter.call(this);

  // We have to suffix all client properties to be safe, since the message
  // names aren't prefixed with clients (unlike servers).
  this._svc$ = svc;
  this._channels$ = []; // Active channels.
  this._fns$ = []; // Middleware functions.

  this._buffering$ = !!opts.buffering;
  this._cache$ = opts.cache || {}; // For backwards compatibility.
  this._policy$ = opts.channelPolicy;
  this._strict$ = !!opts.strictTypes;
  this._timeout$ = utils.getOption(opts, 'timeout', 10000);

  if (opts.remoteProtocols) {
    insertRemoteProtocols(this._cache$, opts.remoteProtocols, svc, true);
  }

  this._svc$.messages.forEach(function (msg) {
    this[msg.name] = this._createMessageHandler$(msg);
  }, this);
}
function Client ( svc , opts ) { opts = opts || { } ; events . EventEmitter . call ( this ) ; // We have to suffix all client properties to be safe, since the message // names aren't prefixed with clients (unlike servers). this . _svc$ = svc ; this . _channels$ = [ ] ; // Active channels. this . _fns$ = [ ] ; // Middleware functions. this . _buffering$ = ! ! opts . buffering ; this . _cache$ = opts . cache || { } ; // For backwards compatibility. this . _policy$ = opts . channelPolicy ; this . _strict$ = ! ! opts . strictTypes ; this . _timeout$ = utils . getOption ( opts , 'timeout' , 10000 ) ; if ( opts . remoteProtocols ) { insertRemoteProtocols ( this . _cache$ , opts . remoteProtocols , svc , true ) ; } this . _svc$ . messages . forEach ( function ( msg ) { this [ msg . name ] = this . _createMessageHandler$ ( msg ) ; } , this ) ; }
Load-balanced message sender.
Load - balanced message sender .