lib/_thriftHttpClient.js
function Client(host, port, path, service, transport, protocol) {
  if (!service.hasOwnProperty('Client')) {
    throw new Error('Thrift Service must have a Client');
  }

  /**
   * The host of the thrift server
   *
   * @type {string}
   */
  this.host = host;

  /**
   * The port of the thrift server
   *
   * @type {Number}
   */
  this.port = port;

  /**
   * The path for the thrift server
   *
   * @type {string}
   */
  this.path = path;

  /**
   * Whether or not to autoClose connection
   *
   * @type {boolean}
   */
  this.autoClose = true;

  /**
   * The thrift service
   *
   * @type {Object}
   */
  this.service = service;

  /**
   * The thrift transport
   *
   * @type {*|TBufferedTransport}
   */
  this.transport = transport || thrift.TBufferedTransport;

  /**
   * The thrift protocol
   *
   * @type {*|exports.TBinaryProtocol}
   */
  this.protocol = protocol || thrift.TBinaryProtocol;

  /**
   * The Thrift Service Client
   * @type {Client}
   */
  this.client = new service.Client;

  /**
   * The Thrift Client Connection
   *
   * @type {*}
   * @private
   */
  this._connection = null;

  /**
   * The Thrift Client
   *
   * @type {null}
   * @private
   */
  this._client = null;

  /**
   * Whether or not we are connected to thrift
   *
   * @type {boolean}
   */
  this.isConnected = false;

  /**
   * A Success Pre-parser Callback
   * @param {*} data
   * @param {Function} Success Callback
   * @param {Function} Error Callback
   * @type {Function|null}
   */
  this.successCallback = null;

  /**
   * A Error Pre-parser Callback
   * @param {*} data
   * @param {Function} Error Callback
   * @type {Function|null}
   */
  this.errorCallback = null;
}
function Client(host, port, path, service, transport, protocol) {
  if (!service.hasOwnProperty('Client')) {
    throw new Error('Thrift Service must have a Client');
  }

  /**
   * The host of the thrift server
   *
   * @type {string}
   */
  this.host = host;

  /**
   * The port of the thrift server
   *
   * @type {Number}
   */
  this.port = port;

  /**
   * The path for the thrift server
   *
   * @type {string}
   */
  this.path = path;

  /**
   * Whether or not to autoClose connection
   *
   * @type {boolean}
   */
  this.autoClose = true;

  /**
   * The thrift service
   *
   * @type {Object}
   */
  this.service = service;

  /**
   * The thrift transport
   *
   * @type {*|TBufferedTransport}
   */
  this.transport = transport || thrift.TBufferedTransport;

  /**
   * The thrift protocol
   *
   * @type {*|exports.TBinaryProtocol}
   */
  this.protocol = protocol || thrift.TBinaryProtocol;

  /**
   * The Thrift Service Client
   * @type {Client}
   */
  this.client = new service.Client;

  /**
   * The Thrift Client Connection
   *
   * @type {*}
   * @private
   */
  this._connection = null;

  /**
   * The Thrift Client
   *
   * @type {null}
   * @private
   */
  this._client = null;

  /**
   * Whether or not we are connected to thrift
   *
   * @type {boolean}
   */
  this.isConnected = false;

  /**
   * A Success Pre-parser Callback
   * @param {*} data
   * @param {Function} Success Callback
   * @param {Function} Error Callback
   * @type {Function|null}
   */
  this.successCallback = null;

  /**
   * A Error Pre-parser Callback
   * @param {*} data
   * @param {Function} Error Callback
   * @type {Function|null}
   */
  this.errorCallback = null;
}
function Client ( host , port , path , service , transport , protocol ) { if ( ! service . hasOwnProperty ( 'Client' ) ) { throw new Error ( 'Thrift Service must have a Client' ) ; } /**
   * The host of the thrift server
   *
   * @type {string}
   */ this . host = host ; /**
   * The port of the thrift server
   *
   * @type {Number}
   */ this . port = port ; /**
   * The path for the thrift server
   *
   * @type {string}
   */ this . path = path ; /**
   * Whether or not to autoClose connection
   *
   * @type {boolean}
   */ this . autoClose = true ; /**
   * The thrift service
   *
   * @type {Object}
   */ this . service = service ; /**
   * The thrift transport
   *
   * @type {*|TBufferedTransport}
   */ this . transport = transport || thrift . TBufferedTransport ; /**
   * The thrift protocol
   *
   * @type {*|exports.TBinaryProtocol}
   */ this . protocol = protocol || thrift . TBinaryProtocol ; /**
   * The Thrift Service Client
   * @type {Client}
   */ this . client = new service . Client ; /**
   * The Thrift Client Connection
   *
   * @type {*}
   * @private
   */ this . _connection = null ; /**
   * The Thrift Client
   *
   * @type {null}
   * @private
   */ this . _client = null ; /**
   * Whether or not we are connected to thrift
   *
   * @type {boolean}
   */ this . isConnected = false ; /**
   * A Success Pre-parser Callback
   * @param {*} data
   * @param {Function} Success Callback
   * @param {Function} Error Callback
   * @type {Function|null}
   */ this . successCallback = null ; /**
   * A Error Pre-parser Callback
   * @param {*} data
   * @param {Function} Error Callback
   * @type {Function|null}
   */ this . errorCallback = null ; }
Create a new thrift client

@param {string} host
@param {int} port
@param {string} path
@param {Object} service
@param {Transport} transport
@param {Protocol} protocol

@throws {Error} error If thrift service does not have a Client property

@constructor
Create a new thrift client