code: function transmit(callback) {
    // Will call next(data, next)
    // Expect OUR next to be called with (err) so we know if it worked
    var iRes;
    var iReq;
    var msg = null;
    var outpacket = {
      responses: [],
      requests : []
    };
  
    if (typeof callback !== 'function') {
      callback = this.transmitter;
    }
    if (!this.active || typeof callback !== 'function') {
      return this;
    }
  
    iRes = this.outbox.responses.length;
    iReq = this.outbox.requests.length;
    if (
      iRes > 0
      && iReq > 0
      && 'system.extension.dual-batch' in this.remoteComponents
    ) {
      // Use dual-batch extension to send it all at once
      outpacket = msg = {
        responses: this.outbox.responses,
        requests : this.outbox.requests
      };
      // Setting length=0 would preserve references and we want to renew them
      this.outbox.responses = [];
      this.outbox.requests = [];
    } else if (iRes > 0) {
      // Responses have priority over requests
      if (iRes > 1) {
        outpacket.responses = msg = this.outbox.responses;
        this.outbox.responses = [];
      } else {
        outpacket.responses.push(msg = this.outbox.responses.pop());
      }
    } else if (iReq > 0) {
      if (iReq > 1) {
        outpacket.requests = msg = this.outbox.requests;
        this.outbox.requests = [];
      } else {
        outpacket.requests.push(msg = this.outbox.requests.pop());
      }
    } else {
      return this;
    }
  
    // Send msg using callback
    setImmediate(
      callback,
      JSON.stringify(msg),
      confirmTransmit.bind(this, outpacket)
    );
  
    return this;
  }
docs: I/O 
  Send a message if there is something in the queue
  
  @param {JRPC~transmitCallback} callback Transmission handler
  
  @return {JRPC} This instance, for chaining