Lines Matching refs:when
33 def __init__(self, when: Optional[float]) -> None:
36 - If `when` is `None`, the timeout will never trigger.
37 - If `when < loop.time()`, the timeout will trigger on the next
44 self._when = when
46 def when(self) -> Optional[float]:
50 def reschedule(self, when: Optional[float]) -> None:
58 self._when = when
63 if when is None:
67 if when <= loop.time():
70 self._timeout_handler = loop.call_at(when, self._on_timeout)
79 when = round(self._when, 3) if self._when is not None else None
80 info.append(f"when={when}")
128 Useful in cases when you want to apply timeout logic around block
129 of code or in cases when asyncio.wait_for is not suitable. For example:
145 def timeout_at(when: Optional[float]) -> Timeout:
158 when - a deadline when timeout occurs or None to disable timeout logic
164 return Timeout(when)