skillfed

waiter

Delayed iteration for polling and retries.

waiter v1.6 339.3K downloads/30d#7,427 on PyPI31
Permissive license Apache-2.0 Active released

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 waiter

uv

uv add waiter

poetry

poetry add waiter

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

retry with custom delayspolling loop with backoffexponential backoff iteratorasync retry mechanismtimeout-aware retrydelay strategy compositionpoll until condition met
retry-pollingasync-supportbackoff-strategies

More Python Modules packages