roboto.waiters#
Module Contents#
- roboto.waiters.Condition#
- roboto.waiters.Interval#
- exception roboto.waiters.TimeoutError(msg, *args)#
Bases:
Exception
Common base class for all non-exit exceptions.
- Parameters:
msg (str)
- msg: str#
- roboto.waiters.wait_for(condition, args=None, timeout=60 * 5, interval=5, timeout_msg='wait_for timed out')#
Wait for a condition to be truthy.
- Parameters:
condition (Condition) – The condition to wait for. This should be a callable that returns a boolean.
args (Optional[collections.abc.Sequence[Any]]) – The arguments to pass to the condition callable on each iteration.
timeout (float) – The maximum amount of time to wait for the condition to be truthy.
interval (Interval) – The amount of time to wait between iterations. This can be an integer or a callable. If it is a callable, it will be called with the iteration number and should return an integer.
timeout_msg (str) – The message to include in the TimeoutError if the timeout is reached.
- Raises:
TimeoutError – If the timeout is reached before the condition is truthy.
- Returns:
None
- Return type:
None