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
Release history Release notifications | RSS feed
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.4.0.tar.gz
(17.4 kB
view details)
Built Distribution
File details
Details for the file caio-0.4.0.tar.gz
.
File metadata
- Download URL: caio-0.4.0.tar.gz
- Upload date:
- Size: 17.4 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 543d5e1bdfa579ab7e8821980e78561061d523497608a117ed8fc5522fe0fbbb |
|
MD5 | d20dde44b6c2f4948e96a10f84e82682 |
|
BLAKE2b-256 | 8df38ee3a512bd5b0bb94235a4b31b8493bd79d2a82baf6ac96c3f82003d5db7 |
File details
Details for the file caio-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: caio-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 34.3 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6011ea41834df250375cb792afa8b2a49f594415b28ed98b37028e312304e21 |
|
MD5 | 2565180eab454ed6a65c330d431add6d |
|
BLAKE2b-256 | c18c87b65da74f5eabc97e958920bc822bf623537ceb4cd836521c9a80755d35 |