--- id: waiting version: "1.5.0" license: BSD 3-Clause License license_treatment: permissive maintenance: dormant --- # waiting — Utility for waiting for stuff to happen License: permissive · Maintenance: dormant · Downloads: 612.7K/mo ## What it is and what it does Waiting is a small polling utility that repeatedly calls a predicate function until it returns True, handling timeouts and sleep intervals. It's designed for scenarios where you need to wait for a condition to be satisfied—such as a resource becoming available, a service becoming ready, or a background task completing—without blocking or busy-waiting. The library supports flexible polling strategies: fixed sleep intervals, exponential backoff with configurable growth rates, and aggregation of multiple predicates using ANY and ALL constructs. It can suppress specific exceptions during polling, invoke a callback after each poll cycle, and provide descriptive timeout messages. With no runtime dependencies and pure-Python implementation, it integrates easily into test suites, integration code, and operational scripts. Use it for: - Test fixtures that wait for a service to become ready before running test cases. - Integration code that polls an API or resource until a desired state is reached, with exponential backoff to reduce load. - Operational scripts that wait for multiple conditions to be satisfied before proceeding (using ANY or ALL aggregators). - Retry logic that waits for transient failures to resolve, ignoring expected exceptions during polling. - Monitoring or health-check loops that periodically verify a condition and log progress via on_poll callbacks. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Waiting is a lightweight library for polling a predicate function until it returns True, with support for timeouts, custom sleep intervals, exponential backoff, and aggregation of multiple predicates. Yes. Waiting is a stable, lightweight utility with no dependencies, permissive licensing, and a clear use case in testing and operational code. The dormant maintenance status is not a concern for a mature, focused library with no known vulnerabilities. Install it if you need straightforward predicate polling with timeout and backoff support. ## Install pip install waiting uv add waiting poetry add waiting ## Installing waiting Before you install: Low friction: pure Python wheel with no runtime dependencies. Dormant maintenance status (716 days since last release), but the package is stable and has been in use since 2011. License in practice: BSD 3-Clause License is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: from waiting import wait, TimeoutExpired predicate = lambda: True result = wait(predicate, timeout_seconds=10) # With exponential backoff result = wait(predicate, sleep_seconds=(1, 100)) # Catch timeout try: wait(lambda: False, timeout_seconds=5, waiting_for="something") except TimeoutExpired: pass Requires Python 3.8 or later. Verify before relying: - Whether the package works correctly with flux for simulated timelines (mentioned in description but not detailed). - Performance characteristics when polling very frequently or with many predicates aggregated via ANY/ALL. ## Package facts - License: BSD 3-Clause License (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 612.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags polling predicate function, wait for condition to be true, timeout polling library, exponential backoff retry, wait until predicate satisfied, polling with timeout, condition polling utility, polling, testing-utility, retry-logic [View on SkillFed](https://skillfed.io/packages/waiting) · [View on PyPI](https://pypi.org/project/waiting/)