Crate actix[][src]

Expand description

Actix is an actor framework.

Actors are objects which encapsulate state and behavior, they communicate exclusively by exchanging messages. Actix actors are implemented on top of Tokio. Multiple actors can run in same thread. Actors can run in multiple threads using the Arbiter API. Actors exchange typed messages.

Other Documentation

Features

  • Async/Sync actors
  • Actor communication in a local/thread context
  • Using Futures for asynchronous message handling
  • Actor supervision
  • Typed messages (No Any type). Generic messages are allowed
  • Runs on stable Rust 1.40+

Package feature

  • resolver - enables DNS resolver actor; see resolver module

Tokio runtime

At the moment actix uses current_thread runtime.

While it provides minimum overhead, it has its own limits:

  • You cannot use Tokio’s async file I/O, as it relies on blocking calls that are not available in current_thread
  • Stdin, Stderr and Stdout from tokio::io are the same as file I/O in that regard and cannot be used in asynchronous manner in actix.

Re-exports

pub use crate::fut::ActorFuture;
pub use crate::fut::ActorStream;
pub use crate::fut::WrapFuture;
pub use crate::fut::WrapStream;
pub use crate::registry::ArbiterService;
pub use crate::registry::Registry;
pub use crate::registry::SystemRegistry;
pub use crate::registry::SystemService;
pub use crate::sync::SyncArbiter;
pub use crate::sync::SyncContext;

Modules

Helper actors

A configurable source of time.

The actix prelude for library developers.

Custom Future implementation with Actix support

The actix prelude.

Actors registry

Sync Actors support

Structs

A helper type for representing different types of message responses.

The address of an actor.

Arbiters provide an asynchronous execution environment for actors, functions and futures. When an Arbiter is created, it spawns a new OS thread, and hosts an event loop. Some Arbiter functions execute on the current thread.

A specialized actor future holder for atomic asynchronous message handling.

An actor execution context.

A helper type that implements the MessageResponse trait.

The Recipient type allows to send one specific message to an actor.

Helper type for representing different type of message responses

A handle to a spawned future.

Actor supervisor

System is a runtime manager.

Helper object that runs System’s event loop

A weakly referenced counterpart to Addr<A>.

Enums

Actor execution state

The errors that can occur during the message delivery process.

Traits

Actors are objects which encapsulate state and behavior.

Actor execution context.

Asynchronous execution context.

Describes how to handle messages of a specific type.

Represent message that can be handled by an actor.

Stream handler

Actors with the ability to restart after failure.

Functions

Starts the system and executes the supplied future.

Spawns a future on the current arbiter.

Type Definitions

A specialized actor future for asynchronous message handling.

A specialized future for asynchronous message handling.