过期回调函数.

        如果设置了timeout则会启动一个协程按当前时间和最近的响应时间只差递归的执行这个回调
492289
def timeout_callback(self):
        
        # Check if elapsed time since last response exceeds our configured
        # maximum keep alive timeout value
        now = time()
        time_elapsed = now - self._last_response_time
        if time_elapsed < self.timeout:
            time_left = self.timeout - time_elapsed
            self._timeout_handler = (
                self._loop.call_later(
                    time_left,
                    self.timeout_callback
                )
            )
        else:
            logger.info('KeepAlive Timeout. Closing connection.')
            responseb = self.encoder({
                "MPRPC": self.VERSION,
                "CODE": 504
            })
            self._stream_writer.write(responseb)
            self.close()
907015
def resetTimeout(self):
        """"""
        if self.__timeoutCall is not None and self.timeOut is not None:
            self.__timeoutCall.reset(self.timeOut)
1235155
def wait_running(self, timeout=None):
        

        flag = self._running.wait(timeout)

        if flag is False:
            raise TimeoutExpiredError("Timeout waiting for thread to start running")
540792
def timeout(self, value):
        """"""
        self.check_pyb()
        try:
            self.pyb.serial.timeout = value
        except:
            # timeout is a property so it calls code, and that can fail
            # if the serial port is closed.
            pass
1038556
def timeout(self, value):
        '''
        
        '''
        if not self.params:
            self.params = dict(timeout=value)
            return self
        self.params['timeout'] = value
        return self
1260148
def checkTimeout(self, now):
        """"""
        log.debug("checking for timeout on session %s", self)
        if now - self.last_update > self.timeout:
            raise TftpTimeout("Timeout waiting for traffic")
138450
private void checkTimeoutSession() {
        if(appLastSeen <= 0) return;
        long now = System.currentTimeMillis();
        if ((now - appLastSeen) > Constants.SESSION_LENGTH_MINS * 60 * 1000) {
            getConfigLogger().verbose(getAccountId(), "Session Timed Out");
            destroySession();
            setCurrentActivity(null);
        }
    }
1116337
def get_timeout(self, callback=None):
        
        def got_timeout(a):
            if callable(callback):
                callback(int(a['VisibilityTimeout']))
        self.get_attributes('VisibilityTimeout', callback=got_timeout)
264186
def _start_timeout():
    """"""
    global _timeout

    LOGGER.debug('Adding a new timeout in %i ms', _timeout_interval)
    _maybe_stop_timeout()
    _timeout = ioloop.IOLoop.current().add_timeout(
        ioloop.IOLoop.current().time() + _timeout_interval / 1000.0,
        _on_timeout)
1028237
def wait(self, timeout=None):
        """"""
        self._event.wait(timeout)
        return self._event.isSet()
1352474
def wait(self, timeout=None, raise_error=True):
        
        return self.get(timeout=timeout, raise_error=raise_error)
25352
def run(self, timeout = 0):
        
        ptimeout = int(timeout.microseconds/1000+timeout.seconds*1000
                if timeout else (self.m_resolution if timeout is None else 0))
        if self.tokens:
            epoll_fd = self.epoll_fd
            events = epoll_wait(epoll_fd, 1024, ptimeout)
            len_events = len(events)-1
            for nr, (ev, fd) in enumerate(events):
                act = self.shadow.pop(fd)
                if ev & EPOLLHUP:
                    epoll_ctl(self.epoll_fd, EPOLL_CTL_DEL, fd, 0)
                    self.handle_error_event(act, 'Hang up.', ConnectionClosed)
                elif ev & EPOLLERR:
                    epoll_ctl(self.epoll_fd, EPOLL_CTL_DEL, fd, 0)
                    self.handle_error_event(act, 'Unknown error.')
                else:
                    if nr == len_events:
                        ret = self.yield_event(act)
                        if not ret:
                            epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, ev | EPOLLONESHOT)
                            self.shadow[fd] = act
                        return ret
                    else:
                        if not self.handle_event(act):
                            epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, ev | EPOLLONESHOT)
                            self.shadow[fd] = act

        else:
            sleep(timeout)
1140405
def timeout(self, seconds=None):
        
        if seconds is None:
            self.socketIO.wait()
        else:
            self.socketIO.wait(seconds=seconds)
884771
function(client, window, timeoutSeconds, action, args) {
      this._window = window;
      if (!timeoutSeconds)
        timeoutSeconds = 30;

      var doTimeout = function (action, client, args) {
        return function () {
          return action.apply(client, args);
        };
      };
      this.timeout = setTimeout(doTimeout(action, client, args), timeoutSeconds * 1000);

      this.cancel = function() {
        this._window.clearTimeout(this.timeout);
      };
    }
473258
private void timeout() {
        lock.writeLock().lock();
        try {
            //if already stopped, do nothing, otherwise check times and run the timeout task
            if (!this.stopped) {
                long now = System.nanoTime();
                long remaining = this.targetEnd - now;
                this.timedout = remaining <= FTConstants.MIN_TIMEOUT_NANO;

                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    debugTime("!Start  {0}", this.start);
                    debugTime("!Target {0}", this.targetEnd);
                    debugTime("!Now    {0}", now);
                    debugTime("!Remain {0}", remaining);
                }

                //if we really have timedout then run the timeout task
                if (this.timedout) {
                    debugRelativeTime("Timeout!");
                    this.timeoutTask.run();
                } else {
                    //this shouldn't be possible but if the timer popped too early, restart it
                    debugTime("Premature Timeout!", remaining);
                    start(this.timeoutTask, remaining);
                }
            }
        } finally {
            lock.writeLock().unlock();
        }
    }
440192
private void doWait(long loginTimeoutExpiration) throws SQLException {

        try {
            if (loginTimeoutExpiration > 0) {
                long timeToWait = loginTimeoutExpiration
                                  - System.currentTimeMillis();

                if (timeToWait > 0) {
                    this.wait(timeToWait);
                } else {
                    throw new SQLException(
                        "No connections available within the given login timeout: "
                        + getLoginTimeout());
                }
            } else {
                this.wait();
            }
        } catch (InterruptedException e) {
            throw new SQLException(
                "Thread was interrupted while waiting for available connection");
        }
    }
1068786
public void timeout(ServletTimer servletTimer) {
		SipSession sipSession = servletTimer.getApplicationSession().getSipSession((String)servletTimer.getInfo());
		if(!State.TERMINATED.equals(sipSession.getState())) {
			try {
				sipSession.createRequest("BYE").send();
			} catch (IOException e) {
				logger.error("An unexpected exception occured while sending the BYE", e);
			}				
		}
	}