Skip to main content

Crate atomr_core

Crate atomr_core 

Source
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 actor subsystem.
dispatch
Dispatcher + mailbox subsystem.
event
Event subsystem — EventStream, DeadLetters, Logging.
io
Network IO — small TCP/UDP helpers mirroring / IO.Udp but exposed as simple functions returning tokio::net primitives 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.

Macros§

fsm