waiter
Delayed iteration for polling and retries.
What it is and what it does
Waiter is a retry and polling library that replaces decorator-based approaches with iteration. Instead of wrapping functions with retry decorators, you create a delay object (e.g., `wait(1)` for constant 1-second delays, or `wait(1) * 2` for exponential backoff) and iterate over it in a loop. Each iteration yields the elapsed time and sleeps as needed before the next attempt. The library supports common delay strategies like incremental backoff, Fibonacci, polynomial, and exponential sequences, all composable through operator overloading.
Waiter decouples delay algorithms from your application logic, making it easier to customize retry behavior per call site and to handle different exceptions or results with custom logic. It includes functional methods like `retry()`, `poll()`, and `repeat()` for common patterns, plus async support for coroutine-based retries. The iteration-based design means you control the loop body entirely—logging, exception handling, and early exit are all straightforward.
Use it for:
- Retrying flaky API calls with exponential backoff and jitter to avoid thundering herd.
- Polling an external service until a condition is met, with a timeout to prevent infinite loops.
- Throttling iteration over results from a generator with configurable delays between items.
- Testing code that depends on eventual consistency by polling a predicate until it succeeds.
- Implementing circuit-breaker patterns with custom delay sequences that escalate over time.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Waiter provides iteration-based retry and polling with customizable delay strategies, decoupling timing logic from application code through composable delay objects rather than decorators.
Yes. Waiter is actively maintained, has no dependencies, supports current Python versions, carries a permissive license, and solves a real problem—retry/polling logic—in a cleaner, more flexible way than decorator-based alternatives. The iteration model is genuinely easier to reason about and customize. No known vulnerabilities.
Install
waiter on PyPI
pip
pip install waiteruv
uv add waiterpoetry
poetry add waiterInstalling waiter
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with a release 19 days old; supports current Python versions (3.11–3.15) and has been stable since its first release in 2016.
License in practice
Apache-2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
from waiter import wait
# Create a delay strategy
for elapsed in wait(1): # repeat every 1 second
try:
result = some_operation()
break
except TemporaryError:
pass # loop sleeps, then retries
# Or use exponential backoff
backoff = wait(1) * 2 # 1, 2, 4, 8, ...
for _ in backoff:
if check_condition():
break
Verify before relying
- Whether the stats interface remains stable or will change in future releases, given it is marked provisional.
- Performance characteristics when used with very large delay sequences or long-running polling loops.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 19 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 339,282/month — #7,427 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: waiter-1.6-py3-none-any.whl
Keywords: wait, retry, poll, delay, sleep, timeout, incremental, exponential, backoff, async
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
polling2Polling2 lets you wait for a function to return…
permissive · top 5,000 on PyPI
reretryA decorator and function wrapper for retrying…
permissive · top 15,000 on PyPI
waitingWaiting is a lightweight library for polling a…
permissive · top 15,000 on PyPI
timeout-samplerPolls a function repeatedly within a timeout…
permissive · top 15,000 on PyPI
retryProvides a decorator and function wrapper for…
permissive · top 1,000 on PyPI
backoffProvides function decorators to automatically…
permissive · top 1,000 on PyPI
python-backoffProvides function decorators for retrying…
permissive · top 5,000 on PyPI
retryingRetrying is a decorator-based library that adds…
permissive · top 1,000 on PyPI
busypieProvides expressive, fluent API for…
permissive · top 15,000 on PyPI
aioretryProvides a decorator-based retry mechanism for…
permissive · top 15,000 on PyPI