Skip to main content

subinterpreters for asyncio.

Project description

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)

Project details


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

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for async_interpreters-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a0210e1ecab28435d176fb4622b1ea7dc713fc6b75a62f5685f0e7f92525236
MD5 0d338bfa3c0b5456700541d614cb9843
BLAKE2b-256 93ff2596b75753a28390f5b296456e807ecb1b3ba389f377f7b1c9609272a846

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page