Skip to main content

xan_actor/
lib.rs

1pub mod actor;
2pub mod actor_system;
3mod error;
4pub mod prelude;
5#[cfg(test)]
6mod test;
7pub mod types;
8
9pub use actor::*;
10pub use actor_system::*;
11pub use error::ActorError;
12pub use types::{JobSpec, Message};
13pub(crate) use types::{Mailbox, TypedMailbox};
14
15#[cfg(feature = "bounded-channel")]
16pub(crate) const CHANNEL_SIZE: usize = 4096;
17
18#[macro_use]
19extern crate log;
20
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22/// Represents the lifecycle of an actor
23pub enum LifeCycle {
24    Starting,
25    Receiving,
26    Stopping,
27    Terminated,
28    Restarting,
29}
30
31#[derive(Clone, Copy, Debug, PartialEq, Eq)]
32/// Behavior of an actor on error
33pub enum ErrorHandling {
34    Resume,
35    Restart,
36    Stop,
37}
38
39#[derive(Clone, Copy, Debug, PartialEq, Eq)]
40/// Blocking or Non-blocking
41pub enum Blocking {
42    Blocking,
43    NonBlocking,
44}