{"id":16752220,"url":"https://github.com/asomers/mio-aio","last_synced_at":"2025-03-15T13:31:02.180Z","repository":{"id":21364038,"uuid":"84002892","full_name":"asomers/mio-aio","owner":"asomers","description":"POSIX AIO bindings for mio","archived":false,"fork":false,"pushed_at":"2024-05-12T00:50:07.000Z","size":1350,"stargazers_count":18,"open_issues_count":1,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-12T19:33:38.840Z","etag":null,"topics":["mio","posix-aio","rust","tokio-rs"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asomers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-05T21:17:48.000Z","updated_at":"2024-06-23T22:39:12.959Z","dependencies_parsed_at":"2024-03-06T01:24:51.350Z","dependency_job_id":"c9f73be9-5fb4-4c11-9d3e-60cf34fcb01c","html_url":"https://github.com/asomers/mio-aio","commit_stats":{"total_commits":120,"total_committers":3,"mean_commits":40.0,"dds":"0.025000000000000022","last_synced_commit":"75799d2ce511032cac58ac05712758db0e481e9c"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asomers%2Fmio-aio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asomers%2Fmio-aio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asomers%2Fmio-aio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asomers%2Fmio-aio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asomers","download_url":"https://codeload.github.com/asomers/mio-aio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243735804,"owners_count":20339532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mio","posix-aio","rust","tokio-rs"],"created_at":"2024-10-13T02:46:17.133Z","updated_at":"2025-03-15T13:31:01.777Z","avatar_url":"https://github.com/asomers.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mio-aio\n\nA library for integrating file I/O with [mio], using POSIX AIO and kqueue.\nFile I/O can be seamlessly mixed with network I/O and timers in the same event\nloop.\n\n[![Build Status](https://api.cirrus-ci.com/github/asomers/mio-aio.svg)](https://cirrus-ci.com/github/asomers/mio-aio)\n[mio]: https://github.com/carllerche/mio\n\n```toml\n# Cargo.toml\n[dependencies]\nmio-aio = \"0.7.0\"\nmio = \"0.8.0\"\n```\n\n## Usage\n\nUsage of this crate is based on the `mio_aio::AioCb` type, which is a wrapper\naround `nix::AioCb`.  You can create one using constructors that are similar to\nwhat `nix` provides.  Registration is the same as any `mio` type, except that\n`AioCb` must be individually registered.  The underlying file does not get\nregistered with `mio`.  Once registered, you can issue the `AioCb` using\nmethods that wrap the `nix` type: `read`, `write`, etc.  After `mio`'s `poll`\nmethod returns the event, call `AioCb::aio_return` to get the final status.  At\nthis point, the kernel has forgotten about the `AioCb`.  There is no need to\nderegister it (though deregistration does not hurt).\n\n\n# Platforms\n\n`mio-aio` works on FreeBSD.  It will probably also work on DragonflyBSD.\nIt does not work on Linux or MacOS.\n\nUnfortunately, Linux includes a poor implementation of POSIX AIO that emulates\nasynchronous I/O in glibc using userland threads.  Worse, epoll(2) can't\ndeliver completion notifications for POSIX AIO.  That means that it can't be\nsupported by `mio-aio`.  But there's still hope for Linux users!  Linux has a\nnon-standard asynchronous file I/O API called libaio.  Libaio has better\nperformance than Linux's POSIX AIO.  It still can't deliver completion\nnotification throuh epoll(2), however.  What it can do is deliver completion\nnotification through an eventfd(2).  And epoll can poll an eventfd.  So a Linux\nprogrammer wishing to use `mio` with files could theoretically write a\n`mio-libaio` crate that uses one eventfd per reactor to poll all libaio\noperations .  Then he could implement a portability layer above `mio`, for\nexample in `tokio`.\n\nOn MacOS AIO only supports notification using signals, not kqueue.  On MacOS\n`mio-aio` could theoretically run `aio-suspend` in a separate thread, which\nwould send completion notification to the main thread's reactor.  Performance\nwould suffer, however.\n\n# License\n\n`mio-aio` is primarily distributed under the terms of both the MIT license and\nthe Apache License (Version 2.0).\n\nSee LICENSE-APACHE, and LICENSE-MIT for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasomers%2Fmio-aio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasomers%2Fmio-aio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasomers%2Fmio-aio/lists"}