Skip to main content

async-interpreters

subinterpreters for asyncio

Usage

from async_interpreters import WorkersPool

workers = WorkersPool(max_size=10, timeout=5)

def calc_sum(a, b):
    sum = a
    for i in range(b):
        sum += i
    return sum


async def usage():
    await workers.run_sync(calc_sum, 10, 100_000_000)


async def benchmark():
    t = time.perf_counter()
    await asyncio.gather(*(usage() for _ in range(10)))
    print(time.perf_counter() - t)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

async_interpreters-0.1.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file async_interpreters-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for async_interpreters-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e082c9f8e53e03979abda70e1e3d40da681df9ce6912098eb37d0b7d9e53a1ea
MD5 1df84f5295767dcebc3f885619f9c26a
BLAKE2b-256 b11e88c60d47ae2cc6d595794070cd97141c8d5a2163e054c931106012c34a25

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 file

0.1.3

1 file

0.1.2

1 file

0.1.0

1 file

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