# Page and retry policies

> Pagination results, batch order results, and the retry and reconnect policies.

Source: https://docs.stxapp.io/sdks/python/reference/helpers/

{/* Generated from the Python source by tools/gen_reference.py. Do not edit by hand. */}

## `Page`

A `Sequence` of models plus the `cursor` for the next page.

### Attributes

| Attribute | Type | Description |
|---|---|---|
| `has_more` | `bool` | `True` when another page exists. |

## `BatchOrderResult`

One entry of `place_orders`: the order, or why it was not placed.

Results come back in the order the orders were sent. Exactly one of
`order` and `errors` is set.

### Attributes

| Attribute | Type | Description |
|---|---|---|
| `order` | `Optional[Order]` |  |
| `errors` | `Optional[List[str]]` |  |
| `ok` | `bool` | `True` when the order was placed. |

## `RetryPolicy`

How many times to try a call, and how long to wait between tries.

The default is 3 attempts, 0.5 s initial backoff doubling to a 30 s cap,
with jitter. `RetryPolicy(max_attempts=1)` (or `stx.NO_RETRY`) turns
retries off.

### Attributes

| Attribute | Type | Description |
|---|---|---|
| `max_attempts` | `int` |  |
| `initial_backoff` | `float` |  |
| `max_backoff` | `float` |  |
| `jitter` | `bool` |  |
| `retryable_exceptions` | `Tuple[Type[STXException], ...]` |  |

### Methods

#### `compute_backoff()`

```python
compute_backoff(attempt: int, exc: STXException) -> float
```

Seconds to wait after attempt `attempt` (1-based) failed.

| Parameter | Type | Description |
|---|---|---|
| `attempt` | `int` |  |
| `exc` | `STXException` |  |

#### `should_retry()`

```python
should_retry(exc: STXException, attempt: int, idempotent: bool) -> bool
```

Whether to try again after `exc` ended attempt number `attempt`.

| Parameter | Type | Description |
|---|---|---|
| `exc` | `STXException` |  |
| `attempt` | `int` |  |
| `idempotent` | `bool` |  |

## `ReconnectPolicy`

Backoff between reconnect attempts. `max_attempts=None` never gives up.

### Attributes

| Attribute | Type | Description |
|---|---|---|
| `initial_backoff` | `float` |  |
| `max_backoff` | `float` |  |
| `max_attempts` | `Optional[int]` |  |
| `jitter` | `bool` |  |

### Methods

#### `delay()`

```python
delay(attempt: int) -> float
```

| Parameter | Type | Description |
|---|---|---|
| `attempt` | `int` |  |
