13 releases

0.4.4 Jan 26, 2024
0.4.3 Jan 25, 2024
0.2.1 Jun 28, 2022
0.2.0 Apr 10, 2022
0.0.0 Jul 5, 2020

#209 in Asynchronous

Download history 67/week @ 2024-08-18 112/week @ 2024-08-25 65/week @ 2024-09-01 98/week @ 2024-09-08 83/week @ 2024-09-15 183/week @ 2024-09-22 105/week @ 2024-09-29 52/week @ 2024-10-06 63/week @ 2024-10-13 51/week @ 2024-10-20 48/week @ 2024-10-27 63/week @ 2024-11-03 31/week @ 2024-11-10 39/week @ 2024-11-17 69/week @ 2024-11-24 69/week @ 2024-12-01

213 downloads per month
Used in 14 crates (6 directly)

Apache-2.0/MIT

165KB
4K SLoC

Nuclei: Proactive IO & Runtime system

Nuclei is a proactor-based IO system which is runtime agnostic and can work with any runtime. The proactor system's design principles are matching Boost Asio. Nuclei is not using a conventional reactor approach. It is completely asynchronous, and it's wrapping poll based IO in a proactive fashion.

Nuclei uses io_uring on Linux as the primary IO backend, secondarily you can use epoll. On MacOS, Nuclei is using kqueue. On Windows, the IOCP backend will be used.

The current io_uring implementation needs a modern Linux kernel (5.19+).

Features

  • Most of the recent IO_URING features are available, ZC and other 6.1+ features are in TODO.
  • Async TCP, UDP, Unix domain sockets and files...
  • The proactor system doesn't block
  • Scatter/Gather operations
  • Minimal allocation
  • More expressive than any other runtime
  • Completely asynchronous I/O system with lock free programming

Examples

Please head to examples directory to run the examples:

$ cd examples
$ cargo run --example fread-vect

Tests

$ cargo test --no-default-features --features=iouring # For iouring
$ cargo test # For others

Configurations

Evented IO backend

When the iouring feature gate is not enabled, the platforms evented backend is used. For example, on Linux, epoll would be used.

Executor

Executor is using async-global-executor. Available features are:

  • async-exec: Uses async-io feature of async-global-executor.
  • tokio

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Credits

Gif is from the documentary called "Particle Fever".

Dependencies

~4–15MB
~192K SLoC