---
sidebar:
  label: roboto.waiters
  order: 35
title: roboto.waiters
---
## Module Contents

### Condition

```python
roboto.waiters.Condition
```

`from roboto.waiters import Condition`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/waiters.py#L12-L12)

### Interval

```python
roboto.waiters.Interval
```

`from roboto.waiters import Interval`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/waiters.py#L13-L13)

Time to sleep between `wait_for`'s calls of its condition, in the form its `interval` argument describes.

### TimeoutError

```python
exception roboto.waiters.TimeoutError(msg: str)
```

`from roboto.waiters import TimeoutError`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/waiters.py#L17-L36)

Bases: [`TimeoutError`](/docs/reference/python-sdk/roboto/waiters#roboto.waiters.TimeoutError)

A wait gave up before its condition was met.

`wait_for` raises it, and so do the SDK methods that wait through it: the `find_*` methods of [`RobotoSearch`](/docs/reference/python-sdk/roboto/roboto_search#roboto.roboto_search.RobotoSearch), the `submit_*_and_await_results` methods of [`QueryClient`](/docs/reference/python-sdk/roboto/query/client#roboto.query.client.QueryClient), [`wait_for_terminal_status()`](/docs/reference/python-sdk/roboto/domain/actions/invocation#roboto.domain.actions.invocation.Invocation.wait_for_terminal_status), [`wait_for_evaluations_to_complete()`](/docs/reference/python-sdk/roboto/domain/actions/trigger#roboto.domain.actions.trigger.Trigger.wait_for_evaluations_to_complete), [`wait_to_be_ready()`](/docs/reference/python-sdk/roboto/domain/custom_fields/custom_field#roboto.domain.custom_fields.custom_field.CustomField.wait_to_be_ready) and [`wait_to_be_deleted()`](/docs/reference/python-sdk/roboto/domain/custom_fields/custom_field#roboto.domain.custom_fields.custom_field.CustomField.wait_to_be_deleted).

Subclasses the built-in `TimeoutError`, so `except TimeoutError` catches it whether or not the caller imported this class.

**Parameters**

- **msg** (`str`)

**Attributes**

- **TimeoutError.msg** (`str`): What was being waited for, and where it stood when the wait gave up.

### wait_for()

```python
def roboto.waiters.wait_for(
    condition: Condition,
    args: Optional[collections.abc.Sequence[Any]] = None,
    timeout: float = 60 * 5,
    interval: Interval = 5,
    timeout_msg: str = 'wait_for timed out',
) -> None
```

`from roboto.waiters import wait_for`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/waiters.py#L39-L80)

Call `condition` until it returns a truthy value, or raise once `timeout` seconds have passed.

The first call happens at once, and each later call follows a sleep of `interval`. Time spent sleeping and in `condition` counts toward `timeout`. The deadline is checked only before a sleep, so the last call can end up to one interval plus one call after `timeout`. A `timeout` of zero or less raises without calling `condition`. An exception `condition` raises propagates and ends the wait.

**Parameters**

- **args** (`Optional[collections.abc.Sequence[Any]]`): Positional arguments to pass to `condition` on every call. `None` passes none.
- **timeout** (`float`): Maximum time to wait, in seconds.
- **interval** (`Interval`): Seconds to sleep before each call after the first, or a function that takes the number of calls made so far and returns the seconds to sleep before the next.
- **timeout_msg** (`str`): Message of the `TimeoutError` raised when `timeout` passes.
- **condition** (`Condition`)

**Raises**

- [`roboto.waiters.TimeoutError`](/docs/reference/python-sdk/roboto/waiters#roboto.waiters.TimeoutError): `condition` returned no truthy value within `timeout`.

**Returns**

- `None`
