Check whether necessary to pause for slave lag
979976
protected function checkPause()
    {
        parent::checkPause();

        foreach ($this->slaves as $slave) {
            $this->checkSlave($slave);
        }
    }
1372947
private void proxyPause() {
        logger.info("Pausing after cluster state has changed to allow proxy bridges to be established. "
                    + "Will start rebalancing work on servers in "
                    + proxyPauseSec
                    + " seconds.");
        try {
            Thread.sleep(TimeUnit.SECONDS.toMillis(proxyPauseSec));
        } catch(InterruptedException e) {
            logger.warn("Sleep interrupted in proxy pause.");
        }
    }
46207
async def pause(self, pause: bool = True):
        
        self._paused = pause
        await self.node.pause(self.channel.guild.id, pause)
830933
protected void checkPaused() throws IOException {
        if (this.paused.get()) {
            synchronized (this.paused) {
                if (this.paused.get()) {
                    PoolUtils.doWorkInPoolNicely(this.jedisPool, new PoolWork<Jedis, Void>() {
                        /**
                         * {@inheritDoc}
                         */
                        @Override
                        public Void doWork(final Jedis jedis) throws IOException {
                            jedis.set(key(WORKER, name), pauseMsg());
                            return null;
                        }
                    });
                }
                while (this.paused.get()) {
                    try {
                        this.paused.wait();
                    } catch (InterruptedException ie) {
                        LOG.warn("Worker interrupted", ie);
                    }
                }
                PoolUtils.doWorkInPoolNicely(this.jedisPool, new PoolWork<Jedis, Void>() {
                    /**
                     * {@inheritDoc}
                     */
                    @Override
                    public Void doWork(final Jedis jedis) {
                        jedis.del(key(WORKER, name));
                        return null;
                    }
                });
            }
        }
    }
1098015
public void pause() {
        checkState();
        if (mState == STATE_PLAYING) {
            PlaybackService.pause(getContext(), mClientKey);
            mState = STATE_PAUSED;
        }
    }
952717
def pause(self):
        """"""
        self._mq.send("p", True, type=1)
        self._paused = True
1230034
private static boolean waitForServerDown(int port, long timeout) {
    long start = System.currentTimeMillis();
    while (true) {
      try {
        Socket sock = new Socket("localhost", port);
        try {
          OutputStream outstream = sock.getOutputStream();
          outstream.write("stat".getBytes());
          outstream.flush();
        } finally {
          sock.close();
        }
      } catch (IOException e) {
        return true;
      }

      if (System.currentTimeMillis() > start + timeout) {
        break;
      }
      try {
        Thread.sleep(250);
      } catch (InterruptedException e) {
        // ignore
      }
    }
    return false;
  }
651295
def pause(self):
        
        log.info("Pausing cluster `%s` ...", self.name)
        failed = self._pause_all_nodes()
        if os.path.exists(self.known_hosts_file):
            os.remove(self.known_hosts_file)
        self.repository.save_or_update(self)
        if failed:
            log.warning(
                    "Not all cluster nodes have been successfully "
                    "stopped.  Some nodes may still be running - "
                    "check error messages above and consider "
                    "re-running `elasticluster pause %s` if "
                    "necessary.", self.name)
422470
private void checkIfLastPacketTimeout() {
     synchronized (ackQueue) {
             if( !ackQueue.isEmpty()  && (
                             System.currentTimeMillis() - lastPacketSentTime > packetTimeout) ) {
               DFSClient.LOG.warn("Packet " + ackQueue.getLast().seqno +
                             " of " + block + " is timed out");
             }
     }
  }
897014
def wait_for_server(host, port, cancel_event=None):
    
    while not is_server_running(host, port):
        # Stop waiting if shutting down
        if cancel_event and cancel_event.is_set():
            return False
        time.sleep(0.1)
    return True
780945
synchronized public void check() {
		if(lastCheckpoint < 0) {
			lastCheckpoint = System.currentTimeMillis();
		}
		
		requests++;
		long interval = System.currentTimeMillis() - lastCheckpoint;
		if(requests >= maxRequests) {
			try {
				long sleepTime = minInterval - interval;
				if(sleepTime > 0) {
					logger.info("Request limit reached. Wait for " + sleepTime/1000 + " seconds");
					Thread.sleep(sleepTime);
				}
			} catch (InterruptedException e) {
				logger.error(e.getMessage());
				return;
			}
			finally {
				requests = 0;
				lastCheckpoint = System.currentTimeMillis();
			}
		}
		else if(interval > minInterval) {
			requests = 0;
			lastCheckpoint = System.currentTimeMillis();
		}
	}
83781
def pause(jid, state_id=None, duration=None):
    '''
    
    '''
    minion = salt.minion.MasterMinion(__opts__)
    minion.functions['state.pause'](jid, state_id, duration)
480160
def _check_timeouts(self):
        

        for conn_id, data in self._connections.items():
            if 'timeout' in data and data['timeout'].expired:
                if data['state'] == self.Connecting:
                    self.finish_connection(conn_id, False, 'Connection attempt timed out')
                elif data['state'] == self.Disconnecting:
                    self.finish_disconnection(conn_id, False, 'Disconnection attempt timed out')
                elif data['state'] == self.InProgress:
                    if data['microstate'] == 'rpc':
                        self.finish_operation(conn_id, False, 'RPC timed out without response', None, None)
                    elif data['microstate'] == 'open_interface':
                        self.finish_operation(conn_id, False, 'Open interface request timed out')
385490
private boolean pauseIfRetryNeeded(int retries) {
        if (retries >= connection.getMaxErrorRetry()) {
            return false;
        }
        long delay = (long) (Math.random() * Math.pow(4, retries) * 125);
        try {
            Thread.sleep(delay);
        } catch (Exception e) {
            throw MwsUtl.wrap(e);
        }
        return true;
    }
334074
def pause():
	""""""

	if not settings.platformCompatible():
		return False

	(output, error) = subprocess.Popen(["osascript", "-e", PAUSE], stdout=subprocess.PIPE).communicate()
177458
def pause(self):
        
        for child in chain(self.consumers.values(), self.workers):
            child.pause()

        for child in chain(self.consumers.values(), self.workers):
            child.paused_event.wait()
645550
function pause(req, res) {
  res.send(null, Constants.OK);
  this.state.pause(req.args[0]);
}