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())
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.6.0.tar.gz
(16.9 kB
view hashes)
Built Distributions
Close
Hashes for caio-0.6.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b2cc8a0abbb21254450068baad96ad2974daa8be4a885d98c161a038f06b789 |
|
MD5 | 6a09636d50922c7e936443f4971cfc65 |
|
BLAKE2b-256 | 4af4859de196b61326acaf50561293dfa549eaf9d112c810e4a2245312667196 |
Close
Hashes for caio-0.6.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa19f861add5b311e1acf79e1946f1582de73af0eb4cfd039800c95fbf5f2171 |
|
MD5 | a6c2597aab4d682566e5dab7e9cf4216 |
|
BLAKE2b-256 | 7ae5c3234fd2810e4c7b1a8c391e6db1bd3bb0c407dd5e736e2cfa0678cc2878 |
Close
Hashes for caio-0.6.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af6272afa3f73dabe317c5e45e27332102161fe5178f610deac34fab7f1a17ca |
|
MD5 | 1e054985750020fb6d770586721f659d |
|
BLAKE2b-256 | 3181e49269102cb4660fefc63efd444418fecba2ae596f084ebc281cff65d48c |
Close
Hashes for caio-0.6.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 531b13fd5df0307ff8a4c57c120c3eafd5b97f4794add3d0f7cbdaa12bcefc0e |
|
MD5 | 733d9bca40afefb9832296565e48678d |
|
BLAKE2b-256 | 4937043fbbe893f8ec6fe43e2d5e375e7e123b7b57f1cba163822ff0880bf840 |
Close
Hashes for caio-0.6.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0099a6c818356ba6e0f9c4f0638e7a7ab83fae175f5632c927e6826a56f705c |
|
MD5 | d12d083da05c7858e430c8d654c23edb |
|
BLAKE2b-256 | fc03da2a06324e23c60dfdd0517890c46cc062587d2ae56b7a5094ac6681e1b1 |
Close
Hashes for caio-0.6.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99cb3456dfad2974fd8c6b63c4bdb0d70b9a56e712b8be087eaa2ad4392bd294 |
|
MD5 | abe20d621b1c24ec6f9c1ed2dd159fab |
|
BLAKE2b-256 | 4f1ffba2107a1639d72028f478ebfeb04946d513d60e5b899716ec31bed5352c |
Close
Hashes for caio-0.6.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87698afa9904eea7714380ad390c09d5242a90f8c2e49f7b74fed73f49bd956c |
|
MD5 | 34d0598fc0b0b6423eeb2a4388449b9c |
|
BLAKE2b-256 | 32150bb8948f2e361cc110404805e5fa6109beed05a6a15eb925c9b9227333e5 |
Close
Hashes for caio-0.6.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7031ee1b963c3cb2b9d00781500e38d5babe9ecf7f5aff532dc31e5e946518c2 |
|
MD5 | a0141386d1e46103445c19fc367727c1 |
|
BLAKE2b-256 | 37a61928161ef2d65b339d1cbf0b90b83a690b38b788209d1f9de5cdb00e2e4f |