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.5.6.tar.gz
(16.6 kB
view hashes)
Built Distributions
Close
Hashes for caio-0.5.6-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05c37bb8403ecf27347690b42e1230138017e58c22d002ba6718ee03a401f96f |
|
MD5 | 1f8b1a1808ad6e1b481f266321dfc0dd |
|
BLAKE2b-256 | 2392811475a0e987b0c76acb0a074acdfe6f43a3df7f6bed54724ec1e5bc76ee |
Close
Hashes for caio-0.5.6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0aaaf05736993fe0f4ca3449ec5548be04fb20ffcfcc4e359afe52effbcafc2 |
|
MD5 | 567ecabfc7f5824a0840eeb99f9d3a03 |
|
BLAKE2b-256 | ffa29c5e1b01b19a8af40c3a3a8653049a6a2e1d01d949fa2105d2e8a7af731c |
Close
Hashes for caio-0.5.6-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17753927de0ed732721cee40c3f81706127f6ff8b2bb8a259bb03a082a9f4390 |
|
MD5 | 34b8cfb0c0f2546cc5b8b2348e8da89f |
|
BLAKE2b-256 | fda172208243e5851e6ec23545cfc5457a7753f7d2808a45dfaf9ca6d42c93ec |
Close
Hashes for caio-0.5.6-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b125689ec3f266c8657d657e4a2ff486fb6e2649a662810a9e849803a8646019 |
|
MD5 | 1e4e8f73772de02fe841391ab8e5fece |
|
BLAKE2b-256 | 532e815a20c3955087c7462814b32b0810b1dc171f902b948ada09a73552d6eb |
Close
Hashes for caio-0.5.6-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa1fb84ee064147181acc5cb30f015226972dd09cd9c8de9a238661eca42b516 |
|
MD5 | 16614f07f9c9a55d09e26e4b3c5f47ed |
|
BLAKE2b-256 | ba6251a8bc1976dd1d3a1cbb8a0f2cc40a9805d85ef20eb748d1a03046b98def |
Close
Hashes for caio-0.5.6-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e495a265992cabd1986271b12d2d2da387191c3c7d668be1443e1fb588900130 |
|
MD5 | d07f0256d5f21300731b4837ab10493b |
|
BLAKE2b-256 | bb0dc62765e330bd7a64329a7287d4facf5c21961272d5ac97a89678bef8bc10 |
Close
Hashes for caio-0.5.6-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1f072b9c63aabde206ff9b471d952d41e149899fd168dc6707806cba9b2a334 |
|
MD5 | 07dac0bdf537f94b15c94269e819e529 |
|
BLAKE2b-256 | bf4e465eaca0262e85f483a292fa380ea8cae005155617e5277c2cf6bbb350b7 |
Close
Hashes for caio-0.5.6-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3bd2dbd9dd0374d01966e8030fe91177de8156f7ac7c825b93d15b4c287610a |
|
MD5 | 549b489dcf56780b3923f7c1b9cd4ba3 |
|
BLAKE2b-256 | d631997bf5525c3a9ad82f120ad13a672a7049931734db298bb4e024f3bbae79 |