Lines Matching full:timeout
12 "Timeout",
13 "timeout",
27 class Timeout: class
30 Use `timeout()` or `timeout_at()` rather than instantiating this class directly.
34 """Schedule a timeout that will trigger at a given loop time.
36 - If `when` is `None`, the timeout will never trigger.
37 - If `when < loop.time()`, the timeout will trigger on the next
51 """Reschedule the timeout."""
55 f"Cannot change state of {self._state.value} Timeout",
73 """Is timeout expired during execution?"""
82 return f"<Timeout [{self._state.value}]{info_str}>"
84 async def __aenter__(self) -> "Timeout":
89 raise RuntimeError("Timeout should be used inside a task")
125 def timeout(delay: Optional[float]) -> Timeout: function
126 """Timeout async context manager.
128 Useful in cases when you want to apply timeout logic around block
131 >>> async with asyncio.timeout(10): # 10 seconds timeout
135 delay - value in seconds or None to disable timeout logic
138 the top-most affected timeout() context manager converts CancelledError
142 return Timeout(loop.time() + delay if delay is not None else None)
145 def timeout_at(when: Optional[float]) -> Timeout:
146 """Schedule the timeout at absolute time.
148 Like timeout() but argument gives absolute time in the same clock system
158 when - a deadline when timeout occurs or None to disable timeout logic
161 the top-most affected timeout() context manager converts CancelledError
164 return Timeout(when)