Ascolt
Async runtime-agnostic actor framework
Features
- Clean syntax for request-response pattern (you just implement
CallHandlerTrait) - Async support
- Handler errors can trigger actor stop, forced stop, or restart (behavior is customizable)
- No built-in child actor concept, but you can run actors within other actors and store their
txin the parent actor's state - No heavy macros
- Strict typing
Examples
let first_actor = FirstActor ;
let = create_channel;
let second_actor = SecondActor ;
let = create_channel;
// if using tokio runtime
spawn;
spawn;
first_actor_tx.tell
.await?; // fire-and-forget
let result = second_actor_tx
.ask
.await?; // request-response
println!;
More examples located at examples directory.
What can be added
- Supervisor for controlling multiple actors
- Dependency graph (e.g., automatically shut down actors when the actors they depend on stop)
- Actor communication over the network