Skip to content

Page and retry policies

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

Attribute Type Description
has_more bool True when another page exists.

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.

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

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.

Attribute Type Description
max_attempts int
initial_backoff float
max_backoff float
jitter bool
retryable_exceptions Tuple[Type[STXException], ...]
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(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

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

Attribute Type Description
initial_backoff float
max_backoff float
max_attempts Optional[int]
jitter bool
delay(attempt: int) -> float
Parameter Type Description
attempt int
v1.5.9Changelogllms.txtllms-full.txt