> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yingtu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Polling

> Poll task status with bounded backoff and a deadline.

Start with a short delay, increase it gradually, and stop at your application
deadline. Treat `queued` and `processing` as non-terminal states.

```python theme={null}
delay = 2
while True:
    task = get_task(task_id)
    if task["status"] in {"succeeded", "failed"}:
        break
    time.sleep(delay)
    delay = min(delay * 1.5, 10)
```

Honor `Retry-After` on `429` responses when it is present.
