Expand description
xtra is a tiny, fast, and safe actor system.
Re-exports
pub use self::address::Address;
pub use self::address::Disconnected;
pub use self::address::WeakAddress;
Modules
An address to an actor is a way to send it a message. An address allows an actor to be sent any
kind of message that it can receive.
A message channel is a channel through which you can send only one kind of message, but to
any actor that can handle it. It is like
Address
, but associated with
the message type rather than the actor type.Commonly used types from xtra
This module contains types representing the strength of an address’s reference counting, which
influences whether the address will keep the actor alive for as long as it lives.
Module for the sink equivalents to
Address
and
MessageChannel
.This module contains a trait to spawn actors, implemented for all major async runtimes by default.
Structs
A manager for the actor which handles incoming messages and stores the context. Its managing
loop can be started with
ActorManager::run
.The operation failed because the actor is being shut down
Context
is used to control how the actor is managed and to get the actor’s address from inside
of a message handler.Enums
Whether to keep the actor running after it has been put into a stopping state.
Traits
An actor which can handle
Message
s one at a time. Actors can only be
communicated with by sending Message
s through their Address
es.
They can modify their private state, respond to messages, and spawn other actors. They can also
stop themselves through their Context
by calling Context::stop
.
This will result in any attempt to send messages to the actor in future failing.A message that can be sent to an
Actor
for processing. They are processed
one at a time. Only actors implementing the corresponding Handler<M>
trait can be sent a given message.