Skip to main content

anyio implementation of an asynchronous Executor.

Project description

Anyio-Executor

Inspired by the newer aiolibs-executor library this library provides an asynchronous executor support for anyio and has compatability with 3.10 and newer version of python.

import anyio

from anyio_executor import Executor


async def fn(i: int):
    await anyio.sleep(i)
    print(f"{i} done!")
    return i

async def main():
    async with Executor(10) as e:
        items = await e.map(fn, [1, 2, 1, 2, 3])
    print(items)

    async with Executor(10) as e:
        # it will also take async for iterations.
        async for i in e.map(fn, [1, 2, 1, 2, 3]):
            print(i)

if __name__ == "__main__":
    anyio.run(main)

Project details


Download files

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

Source Distribution

anyio_executor-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

anyio_executor-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file anyio_executor-0.1.0.tar.gz.

File metadata

  • Download URL: anyio_executor-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for anyio_executor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 be2b43bb544b94c656c15ac31607a2292b5798200738b23d26a8607a6c80e032
MD5 3e93316b95a6e7103a0adf10ade9802b
BLAKE2b-256 f848dac1101a590d53934f9fee94aef6a505738de1bd30423f95f522ba07fc10

See more details on using hashes here.

File details

Details for the file anyio_executor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: anyio_executor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for anyio_executor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 910ac69094908a42564e1c2cdf285d10f232d83deb16883d984c5091e4cde8ee
MD5 211fd44a57663c0176aaba00ccecef5f
BLAKE2b-256 f19ace501abf3b37cbea663b299e9b4bc646c04c4470185f7ccc74537d858a66

See more details on using hashes here.

Supported by

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