Pause the worker for the current loop.

@param ListenerOptions $options
@param int             $lastRestart
502250
protected function pauseWorker(ListenerOptions $options, $lastRestart)
    {
        $this->sleep($options->sleep > 0 ? $options->sleep : 1);

        $this->stopIfNecessary($options, $lastRestart);
    }
583453
function pause () {
        triggerEvent('pause');
        stopLoop(animationId);
        pausedAfter = startTime - performance.now();
        startTime = undefined;
        return self;
      }
991204
protected function runJob(Job $job, ListenerOptions $options)
    {
        try {
            $this->process($job, $options);
        } catch (Exception $e) {
            $this->exceptions->report($e);
        } catch (Throwable $e) {
            $this->exceptions->report(new FatalThrowableError($e));
        }
    }
253623
function (options, callback) {
    if (this.stopAppServerFunc) {
      this.stopAppServerFunc(options, callback);
    } else if (this.appServer) {
      this.appServer.stop(callback);
    } else {
      callback();
    }
  }
645550
function pause(req, res) {
  res.send(null, Constants.OK);
  this.state.pause(req.args[0]);
}
1003732
public function run(array $options = [], callable $onHandledCallback = null): void
    {
        $options = array_merge([
            'sleep' => 1000000,
        ], $options);

        if (\function_exists('pcntl_signal')) {
            pcntl_signal(SIGTERM, function () {
                $this->stop();
            });
        }

        $onHandled = function (?Envelope $envelope) use ($onHandledCallback) {
            if (\function_exists('pcntl_signal_dispatch')) {
                pcntl_signal_dispatch();
            }

            if (null !== $onHandledCallback) {
                $onHandledCallback($envelope);
            }
        };

        while (false === $this->shouldStop) {
            $envelopeHandled = false;
            foreach ($this->receivers as $transportName => $receiver) {
                $envelopes = $receiver->get();

                foreach ($envelopes as $envelope) {
                    $envelopeHandled = true;

                    $this->handleMessage($envelope, $receiver, $transportName, $this->retryStrategies[$transportName] ?? null);
                    $onHandled($envelope);
                }

                // after handling a single receiver, quit and start the loop again
                // this should prevent multiple lower priority receivers from
                // blocking too long before the higher priority are checked
                if ($envelopeHandled) {
                    break;
                }
            }

            if (false === $envelopeHandled) {
                $onHandled(null);

                usleep($options['sleep']);
            }
        }

        $this->dispatchEvent(new WorkerStoppedEvent());
    }
62330
private void pauseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pauseButtonActionPerformed
        switch (pauseButton.getText()) {
			case "Pause":
				_worker.pause();
				pauseButton.setText("Resume");
				break;
			case "Resume":
				_worker.resume();
				pauseButton.setText("Pause");
				break;
			default:
		}
    }
1189189
public function pause()
    {
        $this->paused = true;

        if($this->getProcess()->getPid() == getmypid()) {
            $this->getLogger()->notice('SIGUSR2 received; pausing job processing');
        }else{
            $this->getProcess()->kill(SIGUSR2);
        }

    }
1328713
protected void halt ()
    {
        // only do something if we're actually animating
        if (_animMode != NO_ANIMATION) {
            // disable animation
            setAnimationMode(NO_ANIMATION);
            // come to a halt looking settled and at peace
            String rest = getRestingAction();
            if (rest != null) {
                setActionSequence(rest);
            }
        }
    }
832656
function setLast(method, arg, options) {
    last = {
      method: method,
      arg: arg,
      options: options,
      callback: options.callback,
      page: options.page || 1
    };

    options.method = method;

    if (caching) {
      var last_request = JSON.parse(sessionStorage.getItem('twitterlib.last_request') || '{}');
      if (last.method != last_request.method || last.arg != last_request.arg) {
        clearCache();
        sessionStorage.setItem('twitterlib.last_request', JSON.stringify(last));
      }
    }
  }
49928
private function _pauseOnRetry($retries)
    {
        if ($retries <= $this->_config['MaxErrorRetry']) {
            $delay = (int) (pow(4, $retries) * 100000);
            usleep($delay);
            return true;
        } 
        return false;
    }
1101988
public synchronized void pause(PauseListener listener) {
        closed = true;
        if(configuredServerEndpoints.isEmpty()) {
            listener.paused();
            return;
        }
        if(listener != null) {
            pauseListeners.add(listener);
        }
        for (ConfiguredServerEndpoint endpoint : configuredServerEndpoints) {
            for (final Session session : endpoint.getOpenSessions()) {
                ((UndertowSession)session).getExecutor().execute(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            session.close(new CloseReason(CloseReason.CloseCodes.GOING_AWAY, ""));
                        } catch (Exception e) {
                            JsrWebSocketLogger.ROOT_LOGGER.couldNotCloseOnUndeploy(e);
                        }
                    }
                });
            }
        }

        Runnable done = new Runnable() {

            int count = configuredServerEndpoints.size();

            @Override
            public synchronized void run() {
                List<PauseListener> copy = null;
                synchronized (ServerWebSocketContainer.this) {
                    count--;
                    if (count == 0) {
                        copy = new ArrayList<>(pauseListeners);
                        pauseListeners.clear();
                    }
                }
                if(copy != null) {
                    for (PauseListener p : copy) {
                        p.paused();
                    }
                }
            }
        };

        for (ConfiguredServerEndpoint endpoint : configuredServerEndpoints) {
            endpoint.notifyClosed(done);
        }
    }
499187
public synchronized final void pause() {
        if (isStop) return ;

        isPause = true;
        mPauseTimeInFuture = mStopTimeInFuture - SystemClock.elapsedRealtime();
        mHandler.removeMessages(MSG);
    }
358431
public function pauseAccept()
    {
        if (static::$globalEvent && false === $this->_pauseAccept && $this->_mainSocket) {
            static::$globalEvent->del($this->_mainSocket, EventInterface::EV_READ);
            $this->_pauseAccept = true;
        }
    }
200367
public void setRestartMarker(RestartData restartData)
        throws IOException, ServerException {
        Command cmd = new Command("REST", restartData.toFtpCmdArgument());
        Reply reply = null;
        try {
            reply = controlChannel.exchange(cmd);
        } catch (FTPReplyParseException e) {
            throw ServerException.embedFTPReplyParseException(e);
        }

        if (!Reply.isPositiveIntermediate(reply)) {
            throw ServerException.embedUnexpectedReplyCodeException(
                                new UnexpectedReplyCodeException(reply));
        }
    }
1081554
public void pause() {
        new ExecutionChain(mGvrContext).runOnMainThread(new Runnable() {
            @Override
            public void run() {
                if (!mContentSceneViewStack.isEmpty()) {
                    mContentSceneViewStack.peek().hide();
                    WidgetLib.getTouchManager().setFlingHandler(null);
                }
            }
        }).execute();
    }
1313709
function setListener(callback) {
    if (onFinish) {
      throw new Error('thenDo/finally called more than once');
    }
    if (finished) {
      onFinish = function() {};
      callback(finished.err, finished.result);
    } else {
      onFinish = function() {
        callback(finished.err, finished.result);
      };
    }
  }