Asynchronous file IO for Linux Posix and Windows.
Project description
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.
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
Built Distributions
File details
Details for the file caio-0.7.0.tar.gz
.
File metadata
- Download URL: caio-0.7.0.tar.gz
- Upload date:
- Size: 23.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.45.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d489c1f845956d8600ee87f89f95e12abd4a84b812065161b16687dbfce55d1 |
|
MD5 | 55521541bcd8d58a9c109842effe45cb |
|
BLAKE2b-256 | b47f1cae566d76bcf9bb7b8e17f5934ed59eec2f0b8e233d2483e8e4c69dee5e |
File details
Details for the file caio-0.7.0-cp39-cp39-manylinux2010_x86_64.whl
.
File metadata
- Download URL: caio-0.7.0-cp39-cp39-manylinux2010_x86_64.whl
- Upload date:
- Size: 82.8 kB
- Tags: CPython 3.9, manylinux: glibc 2.12+ 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 | f960fa1a9775a98e5a4e9e38a42a441b1d4caf9ae419ae059fddbfa3fe7839fc |
|
MD5 | 5d47e16bac9db32471b999b45a3a3cf2 |
|
BLAKE2b-256 | a4e1f103856c83a38de23b2cf52485a31621ef7aef2957e9c837c734ef0a5602 |
File details
Details for the file caio-0.7.0-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: caio-0.7.0-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 33.5 kB
- Tags: CPython 3.9, 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 | a18ab4c3b44a1cdafbae7139749274f995e7d81b1612d5113ae960c064b62750 |
|
MD5 | ef82b6234ba6dde143bb12d2c1fcf188 |
|
BLAKE2b-256 | 7fc1917d931d177455299e9cb095e29a0cf730bd5615bc79be94a80780c854a7 |
File details
Details for the file caio-0.7.0-cp38-cp38-manylinux2010_x86_64.whl
.
File metadata
- Download URL: caio-0.7.0-cp38-cp38-manylinux2010_x86_64.whl
- Upload date:
- Size: 108.3 kB
- Tags: CPython 3.8, manylinux: glibc 2.12+ 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 | a1b1d180a4282c1f092aa4bc820954e3370216f3c76f840524fbb2518c6089e8 |
|
MD5 | 29f17e575cadf64a7ef19901d53a3c3e |
|
BLAKE2b-256 | e8540f98c998a87ead7e066b1d1266b2e0523a526d304457b2283cdcd536d0c4 |
File details
Details for the file caio-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: caio-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 43.5 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 | 23b59a307f692b6b6f4c5b05e4eba92c9cde05d9f15254977bf41a9d0c2ba69e |
|
MD5 | 2b3742ce3633fd544e575cbc6a87602c |
|
BLAKE2b-256 | 434ed7f944229fd686ac27f2817ed64170fa419437fcea3dbf49da8ba63804e9 |
File details
Details for the file caio-0.7.0-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: caio-0.7.0-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 83.4 kB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ 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 | 29fe2c3408b8d872364bcefef4bafeee96fe2b284e797f7278b014faec1868e8 |
|
MD5 | 1892b144b340a26399ec11d3caf4ba7b |
|
BLAKE2b-256 | 2be847a4846a79c38525ff0a69e77d2ed681330200c7588e3d58a241f08c923b |
File details
Details for the file caio-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: caio-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 33.5 kB
- Tags: CPython 3.7m, 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 | f8894c56d06a9b7ac8aa77210cdf083511d1dadf5d9b2a227d3a971b848191ed |
|
MD5 | 7988581a41907eede58d0417f99d479a |
|
BLAKE2b-256 | b72ee68d25dd0eb92305260bbee231073fdf52675392ec9537334584e28c473e |
File details
Details for the file caio-0.7.0-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: caio-0.7.0-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 81.6 kB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ 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 | 78c591e419aaca18c0a9ec1d93b60bfde0ee3e3af1731ef36a2bcb3e5c7c3f92 |
|
MD5 | 720dfba532bbaf8911738ca8757e8168 |
|
BLAKE2b-256 | cddbde4102410e10cd9ba16f55592664d7e33332f6defad80d2066fcba16424a |
File details
Details for the file caio-0.7.0-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: caio-0.7.0-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 33.5 kB
- Tags: CPython 3.6m, 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 | 124582536e61a0a348900e97278581be9de0dbecc990af8bcf09844c9e8ce5b8 |
|
MD5 | 047a65c04f7b15e8c6208ccd687e6aea |
|
BLAKE2b-256 | 6fce599d5ac910931c62ae3bc46630c61512315f95a7da35a6f3fbc525188464 |
File details
Details for the file caio-0.7.0-cp35-cp35m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: caio-0.7.0-cp35-cp35m-manylinux2010_x86_64.whl
- Upload date:
- Size: 81.2 kB
- Tags: CPython 3.5m, manylinux: glibc 2.12+ 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 | 5d09dc474e1ec4527ed238429acf333f696a904ffa084305fca231b29dea7278 |
|
MD5 | 325077606725e8c4d6b29eaadebdf7be |
|
BLAKE2b-256 | 117bfadfd7cc5dea12b07ed1b81125b7506d01fbebbd1431fb180c1bf4687c6c |