Python bindings for Linux AIO API and simple asyncio wrapper.
Example
import asyncio
from caio import AsyncioContext
loop = asyncio.get_event_loop()
async def main():
# max_requests=128 by default
ctx = AsyncioContext(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())
Troubleshooting
The linux implementation works normal for modern linux kernel versions and file systems. So you may have problems specific for your environment. It’s not a bug and might be resolved some ways:
Upgrade the kernel
Use compatible file system
Use threads based or pure python implementation.
The caio since version 0.7.0 contains some ways to do this.
1. In runtime use the environment variable CAIO_IMPL with possible values:
linux - use native linux kernels aio mechanism
thread - use thread based implementation written in C
python - use pure python implementation
2. File default_implementation located near __init__.py in caio installation path. It’s useful for distros package maintainers. This file might contains comments (lines starts with # symbol) and the first line should be one of linux thread or python.
Previous versions allows direct import of the target implementation.
Metadata
Release files for caio 0.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| caio-0.8.2.tar.gz | 23.0 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| caio-0.8.2-py3-none-any.whl | Python 3 | none | any | Details |
| caio-0.8.2-cp39-cp39-macosx_10_14_x86_64.whl | CPython 3.9 | CPython 3.9 | macOS 10.14+ x86-64 | Details |
| caio-0.8.2-cp38-cp38-macosx_10_14_x86_64.whl | CPython 3.8 | CPython 3.8 | macOS 10.14+ x86-64 | Details |
| caio-0.8.2-cp37-cp37m-macosx_10_14_x86_64.whl | CPython 3.7 | CPython 3.7 pymalloc | macOS 10.14+ x86-64 | Details |
| caio-0.8.2-cp36-cp36m-macosx_10_14_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | macOS 10.14+ x86-64 | Details |
Total release size: 145.8 kB
Release files / caio-0.8.2.tar.gz
| Download URL | caio-0.8.2.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4918c7e6382c13a52be7b481a52d1ffc8da0805d0c1396255cbc977c448e81b
|
|
BLAKE2b-256 checksum How to use checksums |
5b41167e6b8317ee39291419cd2f1cbc7622a293e27bbb092cfbc7d69b42b188
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
|
Release files / caio-0.8.2-py3-none-any.whl
| Download URL | caio-0.8.2-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fd8e4ab879e25a5503919d0545b62f17078f826fb950ef5ab73129822baa1cf
|
|
BLAKE2b-256 checksum How to use checksums |
1a4569428aa5688e65081b022e65ce9a213915ce6be8e834c63406914830a2a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
|
Release files / caio-0.8.2-cp39-cp39-macosx_10_14_x86_64.whl
| Download URL | caio-0.8.2-cp39-cp39-macosx_10_14_x86_64.whl |
|---|---|
| Size | 27.3 kB |
| Tags | CPython 3.9 macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
ac163d1bc5573681b2db0b9b59c789bac0c1442de82a8cb545f8681fe42fd154
|
|
BLAKE2b-256 checksum How to use checksums |
d4cdcf0cdb9c65012d5cca98f07808e99b3e82fe15f5f57774224602e81f40ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
|
Release files / caio-0.8.2-cp38-cp38-macosx_10_14_x86_64.whl
| Download URL | caio-0.8.2-cp38-cp38-macosx_10_14_x86_64.whl |
|---|---|
| Size | 27.4 kB |
| Tags | CPython 3.8 macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
aadc0f4ad2f5cbfd0772acd20409ba284d46039f00d71f704adf4ff8cb8354e3
|
|
BLAKE2b-256 checksum How to use checksums |
c26e23ab6e57f67be789db781f524f8fff42bc800b93683124cb585157e6565d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
|
Release files / caio-0.8.2-cp37-cp37m-macosx_10_14_x86_64.whl
| Download URL | caio-0.8.2-cp37-cp37m-macosx_10_14_x86_64.whl |
|---|---|
| Size | 27.3 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
cc070ae129e21f720414379a43db14bc3a46a5d3c578bad1cef94b4ceda56319
|
|
BLAKE2b-256 checksum How to use checksums |
46729c0396a170d7355e5a4de2a78974df3ae8794036d1e2bdae18c8ea5f641b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.10
|
Release files / caio-0.8.2-cp36-cp36m-macosx_10_14_x86_64.whl
| Download URL | caio-0.8.2-cp36-cp36m-macosx_10_14_x86_64.whl |
|---|---|
| Size | 27.3 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
5189ea23726948cb4b5d0a3a79db90824654ad07795fab51e75f973ba5c3f20f
|
|
BLAKE2b-256 checksum How to use checksums |
b92e6536140a97f9900fbd186f465c3103df21e52ebbac0779466edf5c59504f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.13
|