| Crates.io | ascolt |
| lib.rs | ascolt |
| version | 0.1.6 |
| created_at | 2025-09-08 07:44:02.123501+00 |
| updated_at | 2025-09-10 08:38:00.921317+00 |
| description | Async runtime-agnostic actor framework |
| homepage | |
| repository | https://github.com/sterrlia/ascolt |
| max_upload_size | |
| id | 1828949 |
| size | 44,740 |
Async runtime-agnostic actor framework
CallHandlerTrait)tx in the parent actor's statelet first_actor = FirstActor {};
let (first_actor_tx, first_actor_rx) = create_channel(100);
let second_actor = SecondActor { first_actor_tx };
let (second_actor_tx, second_actor_rx) = create_channel(100);
// if using tokio runtime
tokio::spawn(start_actor(actor, first_actor_rx));
tokio::spawn(start_actor(second_actor, second_actor_rx));
first_actor_tx.tell(SomeRequest { number: 3 })
.await?; // fire-and-forget
let result = second_actor_tx
.ask(SecondActorCalcRequest(10))
.await?; // request-response
println!("Result: {}", result.0);
More examples located at examples directory.