## waiter


An iterable which sleeps for given delays. Aliased as `wait`.


Usage

``` python
waiter(
    delays,
    timeout=float("inf"),
)
```


## Parameters


`delays iterable | number`  
any iterable of seconds, or a scalar which is repeated endlessly

`timeout number`  
optional timeout for iteration


## Classes

| Name | Description |
|----|----|
| [Stats](#Stats) | Mapping of attempt counts. |

------------------------------------------------------------------------


#### Stats


Mapping of attempt counts.


Usage

``` python
Stats()
```


##### Methods

| Name | Description |
|----|----|
| [add()](#add) | Record attempt and return next value. |


##### add()


Record attempt and return next value.


Usage

``` python
add(attempt, elapsed)
```


## Methods

| Name | Description |
|----|----|
| [__add__()](#__add__) | Generate incremental backoff. |
| [__aiter__()](#__aiter__) | Asynchronously generate a slow loop of elapsed time. |
| [__ge__()](#__ge__) | Limit minimum delay generated. |
| [__getitem__()](#__getitem__) | Slice delays, e.g., to limit attempt count. |
| [__iter__()](#__iter__) | Generate a slow loop of elapsed time. |
| [__le__()](#__le__) | Limit maximum delay generated. |
| [__mul__()](#__mul__) | Generate exponential backoff. |
| [accumulate()](#accumulate) | Create waiter based on `itertools.accumulate`. |
| [count()](#count) | Create waiter based on `itertools.count`. |
| [exponential()](#exponential) | Create waiter with exponential backoff. |
| [fibonacci()](#fibonacci) | Create waiter with fibonacci backoff. |
| [filtered()](#filtered) | Generate `arg, func(arg)` pairs while predicate evaluates to true. |
| [map()](#map) | Return new waiter with function mapped across delays. |
| [poll()](#poll) | Repeat function call until predicate evaluates to true. |
| [polling()](#polling) | Return a decorator for [poll](waiter.md#waiter.waiter.poll). |
| [polynomial()](#polynomial) | Create waiter with polynomial backoff. |
| [random()](#random) | Add random jitter within given range. |
| [repeat()](#repeat) | Repeat function call. |
| [repeating()](#repeating) | A decorator for [repeat](waiter.md#waiter.waiter.repeat). |
| [retry()](#retry) | Repeat function call until exception isn't raised. |
| [retrying()](#retrying) | Return a decorator for [retry](waiter.md#waiter.waiter.retry). |
| [stream()](#stream) | Generate chained values in groups from an iterable. |
| [suppressed()](#suppressed) | Generate `arg, func(arg)` pairs while exception isn't raised. |
| [throttle()](#throttle) | Delay iteration. |

------------------------------------------------------------------------


#### \_\_add\_\_()


Generate incremental backoff.


Usage

``` python
__add__(step)
```


------------------------------------------------------------------------


#### \_\_aiter\_\_()


Asynchronously generate a slow loop of elapsed time.


Usage

``` python
__aiter__()
```


------------------------------------------------------------------------


#### \_\_ge\_\_()


Limit minimum delay generated.


Usage

``` python
__ge__(floor)
```


------------------------------------------------------------------------


#### \_\_getitem\_\_()


Slice delays, e.g., to limit attempt count.


Usage

``` python
__getitem__(slc)
```


------------------------------------------------------------------------


#### \_\_iter\_\_()


Generate a slow loop of elapsed time.


Usage

``` python
__iter__()
```


------------------------------------------------------------------------


#### \_\_le\_\_()


Limit maximum delay generated.


Usage

``` python
__le__(ceiling)
```


------------------------------------------------------------------------


#### \_\_mul\_\_()


Generate exponential backoff.


Usage

``` python
__mul__(factor)
```


------------------------------------------------------------------------


#### accumulate()


Create waiter based on `itertools.accumulate`.


Usage

``` python
accumulate(*args, **kwargs)
```


------------------------------------------------------------------------


#### count()


Create waiter based on `itertools.count`.


Usage

``` python
count(*args, **kwargs)
```


------------------------------------------------------------------------


#### exponential()


Create waiter with exponential backoff.


Usage

``` python
exponential(base, **kwargs)
```


------------------------------------------------------------------------


#### fibonacci()


Create waiter with fibonacci backoff.


Usage

``` python
fibonacci(delay, **kwargs)
```


------------------------------------------------------------------------


#### filtered()


Generate `arg, func(arg)` pairs while predicate evaluates to true.


Usage

``` python
filtered(predicate, func, iterable)
```


------------------------------------------------------------------------


#### map()


Return new waiter with function mapped across delays.


Usage

``` python
map(func, *iterables)
```


------------------------------------------------------------------------


#### poll()


Repeat function call until predicate evaluates to true.


Usage

``` python
poll(predicate, func, *args, **kwargs)
```


------------------------------------------------------------------------


#### polling()


Return a decorator for [poll](waiter.md#waiter.waiter.poll).


Usage

``` python
polling(predicate)
```


------------------------------------------------------------------------


#### polynomial()


Create waiter with polynomial backoff.


Usage

``` python
polynomial(exp, **kwargs)
```


------------------------------------------------------------------------


#### random()


Add random jitter within given range.


Usage

``` python
random(start, stop)
```


------------------------------------------------------------------------


#### repeat()


Repeat function call.


Usage

``` python
repeat(func, *args, **kwargs)
```


------------------------------------------------------------------------


#### repeating()


A decorator for [repeat](waiter.md#waiter.waiter.repeat).


Usage

``` python
repeating(func)
```


------------------------------------------------------------------------


#### retry()


Repeat function call until exception isn't raised.


Usage

``` python
retry(exception, func, *args, **kwargs)
```


------------------------------------------------------------------------


#### retrying()


Return a decorator for [retry](waiter.md#waiter.waiter.retry).


Usage

``` python
retrying(exception)
```


------------------------------------------------------------------------


#### stream()


Generate chained values in groups from an iterable.


Usage

``` python
stream(queue, size=None)
```


The queue can be extended while in use.


------------------------------------------------------------------------


#### suppressed()


Generate `arg, func(arg)` pairs while exception isn't raised.


Usage

``` python
suppressed(exception, func, iterable)
```


------------------------------------------------------------------------


#### throttle()


Delay iteration.


Usage

``` python
throttle(iterable)
```


Async version delays the pull is requested.
