Skip to main content

aioeachlimit

Apply an async function to each item in an array or queue with limited concurrency

Install

pip install aioeachlimit

Usage

async def f(item):
    asyncio.sleep(3)
	return item * 2

items = [1, 2, 3, 4]

async for result in aioeachlimit(items, f, concurrency_limit=2):
	print(result)  # Prints 2 4 6 8 in random order

If you don't need to return anything:

await aioeachlimit(items, f, concurrency_limit=2, discard_results=True)

If items is an asyncio.Queue then aioeachlimit will read from it indefinitely.

Tests

pytest .

Metadata

Release files for aioeachlimit 0.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 aioeachlimit 0.1.0
File Size Uploaded Provenance Actions
aioeachlimit-0.1.0.tar.gz 2.4 kB Without provenance Details for aioeachlimit-0.1.0.tar.gz

Release files / aioeachlimit-0.1.0.tar.gz

Download URL aioeachlimit-0.1.0.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5cace907ee476f0cb579d4d8a5a29034f472cc4c8b98604f8664b63368b9a0ca
BLAKE2b-256 checksum
How to use checksums
7ce210765b5f87959d19548c06c752026fdd5de35ce2086627dd16a53b5a1099
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.1 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.29.1 CPython/3.7.2

Security for aioeachlimit 0.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

0.1.0 This release

1 release file 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