Kameo for Rust: Actors, Supervision, and Remote Messaging
Fault-tolerant async actors for Rust that scale seamlessly
At a glance
- What is it?
- Kameo is a Rust actor library built on Tokio for local and distributed asynchronous systems. It combines typed messaging, supervision, backpressure, and optional libp2p communication.
- Who is it for?
- Kameo fits Rust developers who need typed actors, supervision, and optional libp2p communication in one library. It is excessive for a small local job that could use a direct Tokio task.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 18 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Star history
- tqwewe/kameo1,400 ★ · +2
| Repository | 2026-10-16 | 2026-10-23 |
|---|---|---|
| tqwewe/kameo | 1.4k | 1.4k |
2 Stars in the last 7 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Kameo's Actor Model for Rust Applications
Kameo addresses the problem of organizing concurrent Rust code around independently running actors. Each actor owns state and receives typed messages through an asynchronous channel. The actor runs in its own Tokio task, so callers communicate with it through a reference instead of sharing mutable state directly. This model is useful for web services, data processors, simulation engines, chat applications, monitoring dashboards, and other systems where work can be divided into stateful components.
The intended audience is Rust developers working with asynchronous services. Kameo is not limited to distributed deployments. The README explicitly describes local concurrent systems as valid use cases, and the repository includes examples for basic actors, pools, brokers, pub/sub, streams, supervision, forwarding, and message queues. Distributed communication is an additional capability rather than the only purpose of the library.
The main design choice is type-safe messaging. A message type is associated with a handler and a reply type, which makes the intended interaction visible in Rust code. Kameo also provides bounded and unbounded channels. Bounded channels can apply backpressure when a mailbox fills, while unbounded channels avoid that particular blocking condition but can allow memory use to grow if producers outpace an actor. The README does not provide a universal mailbox sizing rule, so applications must choose channel settings based on their workload.
Typed Messaging and Tokio Task Execution
The documented counter example shows the core flow. A `Counter` actor contains an `i64` field and implements `Message<Inc>`. The handler receives an `Inc` message, changes the actor's private count, and returns the new value. The `Counter::spawn` call creates the actor task and returns an actor reference. The caller then sends `Inc { amount: 42 }` with `ask` and awaits the typed reply.
This arrangement keeps actor state inside the actor's mutable context and leaves callers with an asynchronous interface. It also gives the actor task an isolated failure boundary. The README states that a panic in one actor does not bring down the whole system. That differs from placing unrelated state and tasks directly in one large function, although panic recovery does not cover every logical failure. A handler can still return an error or leave external effects incomplete, and the README does not describe transactional message handling.
The default Cargo features are `macros` and `tracing`. The crate uses Rust edition 2024 and declares `rust-version = "1.88.0"`. Optional features add specific capabilities: `remote` enables libp2p and serialization dependencies, `console` enables the monitoring collector, `metrics` and `otel` add observability integrations, and `hotpath` enables a related timing facility. This feature layout lets an application avoid remote networking or monitoring when it does not need them.
Starting a Counter Actor in a Rust Project
The README gives two installation methods. Editing `Cargo.toml` is suitable when the dependency declaration is already under review. The `cargo add` command is the shorter path for a new project. Both use the documented `0.22` release line, while `Cargo.toml` identifies the package version as `0.22.2`.
The first actor definition declares the actor, defines a message, and implements the typed handler. The README marks this block as ignored Rust, so it illustrates the API rather than presenting a complete application file.
use kameo::Actor;
use kameo::actor::Spawn;
use kameo::message::{Context, Message};
#[derive(Actor)]
struct Counter {
count: i64,
}
struct Inc { amount: i64 }
impl Message<Inc> for Counter {
type Reply = i64;
async fn handle(&mut self, msg: Inc, _ctx: &mut Context<Self, Self::Reply>) -> Self::Reply {
self.count += msg.amount;
self.count
}
}After defining the actor, spawn it and send a message through the returned reference. The expected result is `42`, because the initial count is zero and the message adds 42.
let actor_ref = Counter::spawn(Counter { count: 0 });
let count = actor_ref.ask(Inc { amount: 42 }).await?;
assert_eq!(count, 42);The README does not show the surrounding `main` function, Tokio runtime setup, or concrete error type for this short example. A complete application needs an appropriate async context, which should be selected using the project's API documentation.
Remote Actors Through libp2p
Kameo can make an actor reference available across a network boundary. The README shows registering a local actor under the name `my_actor`, then looking up a remote `RemoteActorRef::<MyActor>`. If lookup succeeds, the caller sends the same typed message shape and awaits a result. Application code uses a remote reference much like a local actor reference while the optional networking layer handles transport concerns.
The networking layer is libp2p. The README names TCP/IP, WebSockets, QUIC, and multiaddresses as possible communication mechanisms. The `remote` feature in `Cargo.toml` includes libp2p capabilities such as `kad`, `noise`, `mdns`, `quic`, `request-response`, `tcp`, `tokio`, and `yamux`. Remote support is therefore more than a small serialization adapter. It introduces peer communication, discovery components, network configuration, and serialization dependencies into the application.
That breadth creates an operational boundary. The README does not document authorization policy, deployment topology, retry semantics, persistence, message ordering during failures, or recovery behavior for a remote actor. It also gives no production recipe for multiaddress configuration. A team adopting `remote` should inspect the network configuration and distributed examples before treating the short lookup example as a complete deployment guide.
Supervision, Backpressure, and the Console
The README says fault tolerance is implemented through supervision strategies. The repository includes `examples/supervision.rs`, and the console can display restarts in its live view. This is useful when an actor is expected to fail and be restarted under a defined policy. However, the README excerpt does not specify the available strategies, restart limits, escalation behavior, or how supervision interacts with remote actors. Those details matter before depending on a particular recovery policy.
Backpressure is controlled through message channels. A bounded channel gives an application a way to limit queued work, but choosing the bound is an application decision. A small bound may cause producers to wait, while a large bound may delay backpressure until substantial work has accumulated. An unbounded channel replaces blocking with the possibility of increasing memory pressure. The repository includes message queue and broker examples, but the README excerpt does not document their configuration syntax.
The optional `kameo console` adds a terminal interface. Its documented panels cover the supervision tree, message throughput, mailbox backpressure, restarts, and deadlocks. An application enables the `console` feature and starts a collector at `127.0.0.1:9999`. The README gives the following dependency declaration:
kameo = { version = "0.22", features = ["console"] }It then documents starting the collector with this call:
let console = kameo::console::serve("127.0.0.1:9999").await?;A separate console binary connects from another terminal:
cargo install kameo_console
kameo-console 127.0.0.1:9999The README does not describe authentication for the collector endpoint, so binding or exposing that endpoint requires separate scrutiny.
Licensing, Releases, and Upgrade Cost
Kameo is published under `MIT OR Apache-2.0`, as stated in `Cargo.toml`, and the repository contains both `LICENSE-MIT` and `LICENSE-APACHE`. That dual-license choice gives downstream users a choice between two license texts, but this review does not provide legal advice about applying them.
The repository is not archived. Its last push was on 2026-10-05. Recent releases listed in the repository metadata include `v0.22.2`, `console-v0.1.4`, and `actors-v0.8.1`, all dated 2026-07-18. The package metadata in `Cargo.toml` is version `0.22.2`, so the workspace and README installation line should be checked together when pinning dependencies. The release list does not provide migration notes, and the README excerpt does not document a compatibility policy.
Upgrading can affect more than the root `kameo` dependency. Enabling `remote`, `console`, `metrics`, or `otel` activates additional dependencies. The workspace also contains members named `actors`, `console`, and `macros`. A project using remote communication or the console should inspect its lockfile and feature changes, particularly when changing Rust versions or optional dependencies. The repository includes `CHANGELOG.md`, but its contents are not quoted here, so specific migration claims cannot be confirmed.
Choosing Kameo Against Direct Tokio Code
Kameo differs from implementing actor-like behavior directly with Tokio channels and tasks. Direct code can be appropriate for a small local workload where one task, one channel, and one state value are sufficient. It avoids adopting a library-specific message trait, actor lifecycle, and supervision model. The trade-off is that the application must define failure handling, queue limits, shutdown, and state ownership itself.
Kameo becomes more relevant when several stateful components need typed requests, actors need independent lifecycles, or a local design may later need remote messaging. Its supervision model and channel abstractions reduce repeated infrastructure code, while the optional remote feature keeps networking out of installations that do not need it. The same abstraction also creates API and operational surface area. A simple application may have little need for registration, remote lookup, console collection, or supervision policy.
The repository's examples cover both simple and broader cases. `examples/basic.rs` represents the direct learning path, while `examples/remote.rs`, `examples/supervision.rs`, and `examples/broker.rs` address larger designs. The README does not compare Kameo with another Rust actor library, so the meaningful alternative here is direct Tokio-based construction rather than a named competitor.
Editorial conclusion
Kameo fits Rust developers who need typed actors, supervision, and optional libp2p communication in one library. It is excessive for a small local job that could use a direct Tokio task. Before adoption, verify supervision behavior, mailbox limits, remote discovery, console exposure, and release-specific changes.
Frequently asked questions
What is Kameo used for in Rust?
Kameo is used to build asynchronous, actor-based Rust systems. Actors own state, process typed messages in Tokio tasks, and can be combined with supervision, bounded or unbounded channels, and optional remote communication.
How do I install Kameo and send the first message?
The README documents adding `kameo = "0.22"` to `Cargo.toml` or running `cargo add kameo`. Its basic example then spawns a `Counter` actor and sends `Inc { amount: 42 }` through `ask`, producing `42`.
Does Kameo support distributed actors?
Yes, the `remote` feature supports distributed actors and uses libp2p for peer-to-peer networking. The README shows registering an actor, looking up a `RemoteActorRef`, and sending a typed message across the network.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/tqwewe-kameo)Star history chart for your README
[](https://hysenlabs.com/projects/tqwewe-kameo)Was this useful?