[−][src]Crate nuclei
Nuclei
Nuclei is a proactive IO system which is runtime agnostic and can work with any runtime. Proactive system's design principles matching to Boost Asio. Nuclei is not using conventional reactor approach. It is completely asynchronous, and it's wrapping poll based IO proactive fashion.
Nuclei uses epoll on Linux as primary evented IO backend, secondarily (if your system supports) you can use io_uring. On MacOS, Nuclei is using kqueue. On Windows, IOCP backend is used.
Current io_uring implementation needs Linux kernel 5.6+.
Features
- Async TCP, UDP, Unix domain sockets and files...
- Proactor system don't block.
- Scatter/Gather operations
- Minimal allocation as much as possible.
- More expressive than any other runtime.
- Completely asynchronous I/O system with lock free programming.
Examples
For more information about how to use Nuclei with std IO types please head to examples.
Executor
Executor is by default set to Bastion's executor. If you want to use
different executor, you can use one of the available runtimes with one of these features:
bastion
, asyncstd
, tokio
, smol
.
Modules
executors | |
join_handle | Generic join handle type. |
prelude | A prelude for the agnostik crate. |
Structs
Agnostik | This struct doesn't have any functionality. It's only use is to have a nice API to create executors for different runtimes. |
Handle | Handle that manages IO submitted to proactor system. |
Proactor | Concrete proactor instance |
Traits
AgnostikExecutor | This trait represents a generic executor that can spawn a future, spawn a blocking task, and wait for a future to finish. |
HandleOpRegisterer | Operation registrar for Proactive IO, represents the outer ring that will send & receive submissions and completions respectively. |
LocalAgnostikExecutor | This trait represents an executor that is capable of spawning futures onto the same thread. |
Functions
block_on |
|
drive | IO driver that drives event systems |
spawn |
|
spawn_blocking |
|
Type Definitions
AsyncOp | Submitted async IO operation type |