| Crates.io | mini_actor |
| lib.rs | mini_actor |
| version | 1.0.0 |
| created_at | 2025-07-16 11:13:30.931342+00 |
| updated_at | 2025-07-16 11:13:30.931342+00 |
| description | The smallest, simplest Rust actor model using Tokio runtime |
| homepage | |
| repository | https://github.com/hsa00000/mini_actor |
| max_upload_size | |
| id | 1755317 |
| size | 37,441 |
The smallest, simplest Rust actor model built on Tokio runtime.
Task)Actor that runs tasks on a Tokio runtimeexecute_waiting() and execute_detached()use tokio::runtime::Runtime;
use mini_actor::{Actor, Task};
struct MyTask;
impl Task for MyTask {
type Output = String;
fn run(self) -> impl std::future::Future<Output = Self::Output> + Send {
async move { "hello".to_string() }
}
}
let rt = Box::leak(Box::new(Runtime::new().unwrap()));
let actor = Actor::new(rt);
let result = actor.execute_waiting(MyTask).await;