Skip to main content

Crate ntex_rt

Crate ntex_rt 

Source
Expand description

Single-threaded asynchronous runtime infrastructure for ntex.

A System owns the runtime configuration and coordinates one or more Arbiter execution threads. Each arbiter runs local futures on its own thread, allowing tasks to use types that are not Send.

Use System::build() to configure a system, spawn() to start a local task, and spawn_blocking() for blocking work.

Runtime backends are selected with Cargo features:

  • no runtime feature uses the native ntex runtime
  • tokio uses the Tokio-based runtime adapter
  • compio uses the Compio-based runtime adapter

Re-exports§

pub use self::rt_default::*;

Modules§

rt_default
signals

Macros§

syscall
Helper macro to execute a system call

Structs§

Arbiter
An asynchronous execution environment running on one OS thread.
BlockingError
Error returned when blocking work cannot produce a result.
BlockingResult
Future resolving to the result of blocking work.
Builder
Builder for an ntex runtime system.
Id
Identifier assigned to a running System.
PingRecord
Runtime
The async runtime for ntex.
RuntimeBuilder
Builder for Runtime.
System
Runtime manager for a group of arbiter threads.
SystemRunner
A configured system that has not yet started its event loop.
ThreadPool
A thread pool for executing blocking operations.

Enums§

DriverType
PollResult

Traits§

Driver
Notify
Runner

Functions§

get_item
Returns a cloned value from the current arbiter’s thread-local storage.
set_item
Inserts a value into the current arbiter’s thread-local storage.
spawn_blocking
Submits blocking work and returns a future for its result.
task_callbacks
Safety
task_opt_callbacks
Safety
with_item
Provides access to a value in the current arbiter’s thread-local storage.

Type Aliases§

BlockFuture