Skip to main content

No project description provided

Project description

Python bindings for Linux AIO API and simple asyncio wrapper.

Example

import asyncio
from linux_aio import AsyncioAIOContext

loop = asyncio.get_event_loop()

async def main():
    # max_requests=128 by default
    ctx = AsyncioAIOContext(max_requests=128)

    with open("test.file", "wb+") as fp:
        fd = fp.fileno()

        # Execute one write operation
        await ctx.write(b"Hello world", fd, offset=0)

        # Execute one read operation
        print(await ctx.read(32, fd, offset=0))

        # Execute one fdsync operation
        await ctx.fdsync(fd)

        op1 = ctx.write(b"Hello from ", fd, offset=0)
        op2 = ctx.write(b"async world", fd, offset=11)

        await asyncio.gather(op1, op2)

        print(await ctx.read(32, fd, offset=0))
        # Hello from async world


loop.run_until_complete(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

caio-0.0.4.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file caio-0.0.4.tar.gz.

File metadata

  • Download URL: caio-0.0.4.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for caio-0.0.4.tar.gz
Algorithm Hash digest
SHA256 d77609a71980365c418721506ba93eeaca86f7f8af5979b5459b9a2186486735
MD5 02a50330d60e436539e9d9ff138efe28
BLAKE2b-256 25e91c3540278cb11e09ba061e57d241f8efeab173ed6e67c9e17c6c5f0afb48

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