Skip to main content

Crate xan_actor

Crate xan_actor 

Source
Expand description

Akka-style actor library for Rust, built on tokio.

Multiple actor types share a single ActorSystem; addresses route messages with compile-time message-type checks (send::<T> only accepts T::Message). Each actor runs on its own task with a bounded or unbounded mailbox, an ErrorHandling policy, and standard lifecycle hooks (pre_start, pre_restart, post_stop, post_restart).

The optional multi-node feature extends the same API across processes via a xanq broker — see the inter_node module and the project wiki for setup details.

See the project wiki for the full guide.

Re-exports§

pub use types::JobController;
pub use types::JobSpec;
pub use types::Message;
pub use types::RunJobResult;
pub use actor::*;
pub use actor_system::*;

Modules§

actor
actor_system
channel
Thin wrapper over tokio::sync::mpsc that hides the bounded / unbounded distinction behind a single API.
prelude
Convenience re-exports for typical actor application code.
types

Enums§

ActorError
All errors surfaced by the actor system.
Blocking
Choice of tokio task primitive used to host the actor’s receive loop.
ErrorHandling
Policy applied when an actor’s handle returns Err.
JobStatus
Snapshot status for a running job (returned only via JobController’s internal channels — currently exposed for completeness; the public API uses abort_job / stop_job / resume_job directly).
LifeCycle
Lifecycle state of a registered actor as tracked by actor_system_loop.

Traits§

MaybeCodec
Bound on Actor::Message / Actor::Result.