Skip to main content

Asynchronous file IO for Linux Posix and Wondows.

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.2.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

caio-0.2.0-cp35-cp35m-macosx_10_6_intel.whl (36.4 kB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

File details

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

File metadata

  • Download URL: caio-0.2.0.tar.gz
  • Upload date:
  • Size: 15.0 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.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5fcb9d0985eae5f932d9b16e154ec6455b48ae577b8b90a85a586a759cb1f22d
MD5 766e163cc95757684b4275d92a6c9f48
BLAKE2b-256 051fef4b17e7e9a176350bb7990b0239bf3b846ed5351dd82ac7ab2fd428b9bb

See more details on using hashes here.

File details

Details for the file caio-0.2.0-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

  • Download URL: caio-0.2.0-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 36.4 kB
  • Tags: CPython 3.5m, macOS 10.6+ intel
  • 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.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.2.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 327c5b181747ce9cbdf578330a178918784272d20bf55ae38335d7b78932dba7
MD5 cf31a3e8df85034a3e5bed75841ab176
BLAKE2b-256 71bb45f6f90eb719a847c847c16209cbca1c34cee7f1b85d52347489c76ab6df

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