lib/oboeRequest.js
/**
   * Make a streaming query to the Devo API.
   *
   * @param {Object} options An object with method, body and headers.
   * @param {Object} callbacks An object with attributes for callbacks:
   *  - meta: receives headers.
   *  - data: receives each row of data.
   *  - error: receives any errors.
   *  - done: optional, invoked after finishing parsing.
   */
Make a streaming query to the Devo API.
@param {Object} options An object with method, body and headers.
@param {Object} callbacks An object with attributes for callbacks:
- meta: receives headers.
- data: receives each row of data.
- error: receives any errors.
- done: optional, invoked after finishing parsing.
Make a streaming query to the Devo API . @param { Object } options An object with method body and headers . @param { Object } callbacks An object with attributes for callbacks : - meta : receives headers . - data : receives each row of data . - error : receives any errors . - done : optional invoked after finishing parsing .
stream(options, callbacks) {
    this._request = oboe({
      method: options.method,
      withCredentials: true,
      url: options.url,
      headers: options.headers,
      body: JSON.stringify(options.body)
    });
    this._request.on('fail', error => callbacks.error(error.thrown || error));
    this._request.on('done', () => {
      if (this._done) return;
      this._done = true;
      if (this._failed) {
        callbacks.error && callbacks.error(this._msg);
      } else {
        callbacks.done && callbacks.done();
      }
    });
    this._request.node(this._getNodes(callbacks));
    return this;
  }
stream ( options , callbacks ) { this . _request = oboe ( { method : options . method , withCredentials : true , url : options . url , headers : options . headers , body : JSON . stringify ( options . body ) } ) ; this . _request . on ( 'fail' , error => callbacks . error ( error . thrown || error ) ) ; this . _request . on ( 'done' , ( ) => { if ( this . _done ) return ; this . _done = true ; if ( this . _failed ) { callbacks . error && callbacks . error ( this . _msg ) ; } else { callbacks . done && callbacks . done ( ) ; } } ) ; this . _request . node ( this . _getNodes ( callbacks ) ) ; return this ; }
Make a streaming query to the Devo API.
Make a streaming query to the Devo API .