[−][src]Crate actix
Actix is a rust actors 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.
Documentation
- User Guide
- Chat on gitter
- GitHub repository
- Cargo package
- Minimum supported Rust version: 1.26 or later
Features
- Async/Sync actors.
- Actor communication in a local/thread context.
- Using Futures for asynchronous message handling.
- HTTP1/HTTP2 support (actix-web)
- Actor supervision.
- Typed messages (No
Anytype). Generic messages are allowed.
Package feature
resolver- enables dns resolver actor,actix::actors::resolver
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,StderrandStdoutfromtokio::ioare 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
| actors | Helper actors |
| clock | A configurable source of time. |
| dev | The |
| fut | Custom |
| io | |
| prelude | The |
| registry | Actors registry |
| sync | Sync Actors support |
| utils |
Structs
| ActorResponse | A helper type for representing different types of message responses. |
| Addr | The address of an actor. |
| Arbiter | Arbiters provide an asynchronous execution environment for actors, functions and futures. When an Arbiter is created, they spawn a new OS thread, and host an event loop. Some Arbiter functions execute on the current thread. |
| Context | An actor execution context. |
| MessageResult | A helper type that implements the |
| Recipient | The |
| Response | Helper type for representing different type of message responses |
| SpawnHandle | A handle to a spawned future. |
| Supervisor | Actor supervisor |
| System | System is a runtime manager. |
| SystemRunner | Helper object that runs System's event loop |
| WeakAddr | A weakly referenced counterpart to |
Enums
| ActorState | Actor execution state |
| MailboxError | The errors that can occur during the message delivery process. |
| Running |
Traits
| Actor | Actors are objects which encapsulate state and behavior. |
| ActorContext | Actor execution context. |
| AsyncContext | Asynchronous execution context. |
| Handler | Describes how to handle messages of a specific type. |
| Message | Represent message that can be handled by an actor. |
| StreamHandler | Stream handler |
| Supervised | Actors with the ability to restart after failure. |
Functions
| run | Starts the system and executes the supplied future. |
| spawn | Spawns a future on the current arbiter. |
Type Definitions
| ResponseActFuture | A specialized actor future for asynchronous message handling. |
| ResponseFuture | A specialized future for asynchronous message handling. |