Expand description
§atomr
A native Rust runtime for actor-based concurrent and distributed systems. One programming model — addressable units of state plus behavior, communicating by asynchronous messages — that scales from a single core to a cluster, and increasingly from CPU to GPU.
This is the umbrella crate. Pull in additional subsystems via Cargo feature flags; each feature also re-exports the underlying crate under a stable namespace.
[dependencies]
atomr = { version = "0.1", features = ["cluster", "persistence", "streams"] }ⓘ
use atomr::prelude::*;
use atomr::cluster; // re-export of `atomr-cluster`
use atomr::persistence; // re-export of `atomr-persistence`
use atomr::streams; // re-export of `atomr-streams`§Quick start
ⓘ
use atomr::prelude::*;
#[derive(Default)]
struct Greeter;
#[async_trait::async_trait]
impl Actor for Greeter {
type Msg = String;
async fn handle(&mut self, _ctx: &mut Context<Self>, msg: String) {
println!("hi {msg}");
}
}
let system = ActorSystem::create("S", Config::empty()).await?;
let greeter = system.actor_of(Props::create(Greeter::default), "greeter")?;
greeter.tell("world".to_string());
system.terminate().await;§Feature flags
| Feature | Re-exports as | What it adds |
|---|---|---|
macros (default) | atomr::macros | #[derive(Actor)], props!, #[derive(Receive)] |
testkit | atomr::testkit | Probes, virtual time, multi-node spec |
remote | atomr::remote | Cross-process / cross-host messaging |
cluster | atomr::cluster | Membership, gossip, reachability, SBR |
cluster-tools | atomr::cluster_tools | Singleton, distributed pub/sub, cluster client |
cluster-sharding | atomr::cluster_sharding | Sharded entities with rebalance |
cluster-metrics | atomr::cluster_metrics | Adaptive load balancing |
distributed-data | atomr::distributed_data | CRDT replicator |
persistence | atomr::persistence | Event sourcing — journals + snapshots |
persistence-query | atomr::persistence_query | Tagged event streams |
streams | atomr::streams | Typed reactive streams DSL |
patterns | atomr::patterns | DDD/CQRS aggregates + readers + sagas |
coordination | atomr::coordination | Lease primitives |
discovery | atomr::discovery | Service discovery |
di | atomr::di | DI container |
hosting | atomr::hosting | Builder API |
telemetry | atomr::telemetry | Tracing, metrics, exporters |
full | (everything above) | Every subsystem + macros + testkit |
cluster-app | (cluster-grade subset) | Cluster-grade application bundle |
Each subsystem also publishes as its own crate (atomr-cluster,
atomr-persistence, …). If you only need one, depending on it
directly avoids the umbrella’s resolver indirection.
See the repository README for architecture and the actors-and-agentic-computing doc for the unified-compute thesis.
Re-exports§
pub use atomr_config as config;pub use atomr_core as core;pub use atomr_macros as macros;macrospub use atomr_testkit as testkit;testkitpub use atomr_remote as remote;remotepub use atomr_cluster as cluster;clusterpub use atomr_cluster_tools as cluster_tools;cluster-toolspub use atomr_cluster_sharding as cluster_sharding;cluster-shardingpub use atomr_cluster_metrics as cluster_metrics;cluster-metricspub use atomr_distributed_data as distributed_data;distributed-datapub use atomr_persistence as persistence;persistencepub use atomr_persistence_query as persistence_query;persistence-querypub use atomr_streams as streams;streamspub use atomr_patterns as patterns;patternspub use atomr_coordination as coordination;coordinationpub use atomr_discovery as discovery;discoverypub use atomr_di as di;dipub use atomr_hosting as hosting;hostingpub use atomr_telemetry as telemetry;telemetry
Modules§
- prelude
- Re-exports of the most commonly used types.