Skip to main content

aiter-timeouts

GitHub Workflow Status PyPI - Downloads

Timeout functionality for asynchronous iterators. Supports timeouts on the total time to exhaust an asynchronous iterator, or the time it takes for any given step.

Supports Python 3.7+.

Example

Just wrap your async iterator in a call to with_timeout, like so:

from aiter_timeouts import with_timeout

async def async_iter():
    for i in range(10):
        await asyncio.sleep(0.5)
        yield i

try:
    async for val in with_timeout(async_iter(), timeout=6, timeout_per_step=1):
        ...
except IterationTimeoutError as e:
    print(f"step {e.step} took too long")
except IteratorTimeoutError as e:
    print(f"only reached step {e.step} before timing out")

License

MIT License Copyright (c) 2023 Elias Gabriel

Metadata

Release files for aiter-timeouts 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiter-timeouts 1.1.0
File Size Uploaded Provenance Actions
aiter_timeouts-1.1.0.tar.gz 3.0 kB Without provenance Details for aiter_timeouts-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aiter-timeouts 1.1.0
File Interpreter ABI Platform Actions
aiter_timeouts-1.1.0-py3-none-any.whl Python 3 none any Details for aiter_timeouts-1.1.0-py3-none-any.whl

Total release size: 6.1 kB

Release files / aiter_timeouts-1.1.0.tar.gz

Download URL aiter_timeouts-1.1.0.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b201ce0c980f036158cd86bc83a1154ea13f2cc72dc37a6b427fdc590ec0439f
BLAKE2b-256 checksum
How to use checksums
5dd656a412cbd13a8feaf8716a66616a7e464ed8a733fbbcdd44cf60379d82fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.10.3 CPython/3.11.2

Release files / aiter_timeouts-1.1.0-py3-none-any.whl

Download URL aiter_timeouts-1.1.0-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3077b64e35466f916fdac6de3bdb932869d13f786eb39d5365d0fb15d4762985
BLAKE2b-256 checksum
How to use checksums
7431970d16a1649c5b893e4e17beca5b548d048078a9e2a7a7f92b6a8f2a4cac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.10.3 CPython/3.11.2

Security for aiter-timeouts 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page