Pause a run

@param {Function} callback
185892
function (callback) {
            callback = backpack.ensure(callback, this);

            if (this.paused) { return callback && callback(new Error('run: already paused')); }

            // schedule the pause command as an interrupt and flag that the run is pausing
            this.paused = true;
            this.interrupt('pause', null, callback);
        }
895934
function stop(callback) {
    if (httpServer) {
        DEBUG && debug('stop http server');
        try {
            httpServer.close();
        } catch (e) {
        }
        httpServer = null;
    } else {
        DEBUG && debug('***ignore*** http server is not running!');
    }
    callback && callback(false);
}
158195
function wait(testCallback, waitCallback) {
          if (!testCallback()) {
            // Wait for timeout
            if ((new Date().getTime()) - startTime < maxLoadTime) {
              Delay.setTimeout(waitCallback);
            } else {
              failed();
            }
          }
        }
617917
function Timer (callback, start) {
  this.callback = callback;
  this.startDate = null;
  if (!exists(start) || start !== false) {
    this.start();
  }
}
388348
function(callback) {
        if (this._isShuttingDown || this._isStartingUp) {
            return;
        }

        this._isShuttingDown = true;

        // See if the app is running.
        if (!this.processId() && !this.sideProcessId()) {
            this._isShuttingDown = false;
            // Nope, not running.
            if (callback) {
                callback();
            }

            return;
        }

        // Kill the app.
        clearTimeout(this._restartTimeout);
        this._appProcess.kill();
        if (this._sideProcess) {
            this._sideProcess.kill();
        }

        // Check on an interval to see if it's dead.
        var check = setInterval(_.bind(function() {
            if (this.processId() || this.sideProcessId()) {
                return;
            }

            clearInterval(check);
            logger.info('App shut down by force.');
            this._isShuttingDown = false;
            if (callback) {
                callback();
            }
        }, this), 250);
    }
927572
function pause() {
        $this->paused = true;
        
        if($this->started && !$this->closed) {
            $this->driver->pauseStreamConsumption();
        }
    }
333172
void waitRun(long waitMillis, int waitNanos, boolean cancelOnTimeOut) {
        if (!mDone) {
            synchronized (this) {
                if (!mDone) {
                    try {
                        this.wait(waitMillis, waitNanos);
                    } catch (InterruptedException ignored) {
                    } finally {
                        if (!mDone && cancelOnTimeOut)
                            mDone = true;
                    }
                }
            }
        }
    }
195929
function debounce (callback, wait, options) {
  var args, context
  var opts = options || {}
  var runFlag = false
  var timeout = 0
  var isLeading = typeof options === 'boolean'
  var optLeading = 'leading' in opts ? opts.leading : isLeading
  var optTrailing = 'trailing' in opts ? opts.trailing : !isLeading
  var clearTimeoutFn = clearTimeout
  var runFn = function () {
    runFlag = true
    timeout = 0
    callback.apply(context, args)
  }
  var endFn = function () {
    if (optLeading === true) {
      timeout = 0
    }
    if (!runFlag && optTrailing === true) {
      runFn()
    }
  }
  var cancelFn = function () {
    var rest = timeout !== 0
    clearTimeoutFn(timeout)
    timeout = 0
    return rest
  }
  var debounced = function () {
    runFlag = false
    args = arguments
    context = this
    if (timeout === 0) {
      if (optLeading === true) {
        runFn()
      }
    } else {
      clearTimeoutFn(timeout)
    }
    timeout = setTimeout(endFn, wait)
  }
  debounced.cancel = cancelFn
  return debounced
}
237423
def mark_pausing(self):
    
    with self._lock:
      self._set_state(self._PAUSING, self._RUNNING)
462368
@JsIgnore
  public static void onReady(Runnable callback) {
    if (isReady) {
      callback.run();
      return;
    }

    onReadyCallbacks.push(callback);
  }
414557
function (callback) {
            async.until(
                // conditions for stopping the poll
                function () {
                    waitTimeOver = elapsed > constants.WAIT_TIMEOUT;
                    return waitTimeOver || domHasChanged;
                },
                function (callback) {
                    // polls the page at an interval
                    setTimeout(function () {
                        elapsed += constants.POLL_INTERVAL;
                        getData.takeSnapshot(page, ph, function (error, page, ph, newDom) {
                            if (error) {
                                callback(error);
                                return;
                            }
                            domHasChanged = helpers.domIsDifferent(originalDom, newDom);
                            callback();
                        });
                    }, constants.POLL_INTERVAL);
                },

                function (error) {
                    if (waitTimeOver) {
                        callback('Timeout while waiting for dom to change');
                        return;
                    }
                    callback(error);
                }
            );
        }
1124699
function debounce(callback){
  var queued = false;
  return function () {
    if(!queued){
      queued = true;
      setTimeout(function () {
        queued = false;
        callback();
      }, 0);
    }
  };
}
142147
def pause(self):
        
        if self._status == TransferState.RUNNING:
            self._running.clear()
            self._status = TransferState.PAUSED
        else:
            raise SbgError('Can not pause. Download not in RUNNING state.')
932458
def pause() -> None:
    
    if _logger is not None:
        _log(INFO, "Process", local.name, "pause")
    Process.current().rsim()._gr.switch()
741143
function pause (stream) {
  var events = []
  var onData = createEventListener('data', events)
  var onEnd = createEventListener('end', events)

  // buffer data
  stream.on('data', onData)

  // buffer end
  stream.on('end', onEnd)

  return {
    end: function end () {
      stream.removeListener('data', onData)
      stream.removeListener('end', onEnd)
    },
    resume: function resume () {
      this.end()

      for (var i = 0; i < events.length; i++) {
        stream.emit.apply(stream, events[i])
      }
    }
  }
}
293412
function stop () {
        currentValues = fromValues;
        triggerEvent('stop');
        stopLoop(animationId);
        pausedAfter = undefined;
        startTime = undefined;
        return self;
      }
26895
function(callback) {
      var t = this;
      callback = callback || function(){};
      var onPong = function() {
        t.off('pong', onPong);
        callback();
      };
      t.on('pong', onPong);
      t.emit('connection:ping');
    }