MCPcopy Create free account
hub / github.com/python-websockets/websockets / shift

Method shift

src/websockets/asyncio/async_timeout.py:207–217  ·  view source on GitHub ↗

Advance timeout on delay seconds. The delay can be negative. Raise RuntimeError if shift is called when deadline is not scheduled

(self, delay: float)

Source from the content-addressed store, hash-verified

205 self._timeout_handler = None
206
207 def shift(self, delay: float) -> None:
208 """Advance timeout on delay seconds.
209
210 The delay can be negative.
211
212 Raise RuntimeError if shift is called when deadline is not scheduled
213 """
214 deadline = self._deadline
215 if deadline is None:
216 raise RuntimeError("cannot shift timeout if deadline is not scheduled")
217 self.update(deadline + delay)
218
219 def update(self, deadline: float) -> None:
220 """Set deadline to absolute value.

Callers

nothing calls this directly

Calls 1

updateMethod · 0.95

Tested by

no test coverage detected