Skip to main content

Crate atomr_core

Crate atomr_core 

Source
Expand description

§atomr-core

Idiomatic Rust port of akka.net/src/core/Akka.

Public modules mirror the upstream folder layout 1:1 to make tracking upstream changes tractable. See PORTING.md at the workspace root.

§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. akka.net: src/core/Akka/Actor.
dispatch
Dispatcher + mailbox subsystem. akka.net: src/core/Akka/Dispatch.
event
Event subsystem — EventStream, DeadLetters, Logging. akka.net: src/core/Akka/Event.
io
Network IO — small TCP/UDP helpers mirroring akka.net’s IO.Tcp / IO.Udp but exposed as simple functions returning tokio::net primitives wrapped in channel-driven actors. akka.net: src/core/Akka/IO.
pattern
Higher-level patterns on top of the core actor primitives. akka.net: src/core/Akka/Pattern.
prelude
routing
Routers — distribute messages across a pool of routees. akka.net: src/core/Akka/Routing/.
serialization
Serialization framework. akka.net: src/core/Akka/Serialization/.
supervision
Supervision. akka.net: Actor/SupervisorStrategy.cs.
util
Core utilities. akka.net: src/core/Akka/Util.

Macros§

fsm