Expand description
§atomr-core
Idiomatic Rust actor runtime — typed actors, hierarchical supervision, dispatchers, mailboxes, scheduler, dead letters, and event streams.
§Quick start
use atomr_core::prelude::*;
#[derive(Default)]
struct Echo;
#[async_trait::async_trait]
impl Actor for Echo {
type Msg = String;
async fn handle(&mut self, _ctx: &mut Context<Self>, msg: String) {
println!("echo: {msg}");
}
}
let sys = ActorSystem::create("S", atomr_config::Config::reference()).await?;
let echo = sys.actor_of(Props::create(Echo::default), "echo")?;
echo.tell("hi".to_string());
sys.terminate().await;Modules§
- actor
- The
actorsubsystem. - dispatch
- Dispatcher + mailbox subsystem.
- event
- Event subsystem — EventStream, DeadLetters, Logging.
- io
- Network IO — small TCP/UDP helpers mirroring /
IO.Udpbut exposed as simple functions returningtokio::netprimitives wrapped in channel-driven actors. - pattern
- Higher-level patterns on top of the core actor primitives.
- prelude
- routing
- Routers — distribute messages across a pool of routees.
- serialization
- Serialization framework.
- supervision
- Supervision.
- util
- Core utilities.