dist/client/lance-gg.js
/**
     * Pauses polling.
     *
     * @param {Function} callback upon buffers are flushed and transport is paused
     * @api private
     */
Pauses polling.
@param {Function} callback upon buffers are flushed and transport is paused
@api private
Pauses polling . @param { Function } callback upon buffers are flushed and transport is paused @api private
pause(onPause) {
      const self = this;
      this.readyState = "pausing";
      function pause() {
        debug("paused");
        self.readyState = "paused";
        onPause();
      }
      if (this.polling || !this.writable) {
        let total = 0;
        if (this.polling) {
          debug("we are currently polling - waiting to pause");
          total++;
          this.once("pollComplete", function() {
            debug("pre-pause polling complete");
            --total || pause();
          });
        }
        if (!this.writable) {
          debug("we are currently writing - waiting to pause");
          total++;
          this.once("drain", function() {
            debug("pre-pause writing complete");
            --total || pause();
          });
        }
      } else {
        pause();
      }
    }
pause ( onPause ) { const self = this ; this . readyState = "pausing" ; function pause ( ) { debug ( "paused" ) ; self . readyState = "paused" ; onPause ( ) ; } if ( this . polling || ! this . writable ) { let total = 0 ; if ( this . polling ) { debug ( "we are currently polling - waiting to pause" ) ; total ++ ; this . once ( "pollComplete" , function ( ) { debug ( "pre-pause polling complete" ) ; -- total || pause ( ) ; } ) ; } if ( ! this . writable ) { debug ( "we are currently writing - waiting to pause" ) ; total ++ ; this . once ( "drain" , function ( ) { debug ( "pre-pause writing complete" ) ; -- total || pause ( ) ; } ) ; } } else { pause ( ) ; } }
Pauses polling.
Pauses polling .