---
sidebar:
  label: roboto.waiters
  order: 33
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)

### 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#L16-L28)

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

A wait gave up before its condition was met.

Subclasses the built-in [`TimeoutError`](/reference/python-sdk/roboto/waiters#roboto.waiters.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#L31-L72)

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`](/reference/python-sdk/roboto/waiters#roboto.waiters.TimeoutError): If the timeout is reached before the condition is truthy.

**Returns**

- `None`: None
