mini_actor

Crates.iomini_actor
lib.rsmini_actor
version1.0.0
created_at2025-07-16 11:13:30.931342+00
updated_at2025-07-16 11:13:30.931342+00
descriptionThe smallest, simplest Rust actor model using Tokio runtime
homepage
repositoryhttps://github.com/hsa00000/mini_actor
max_upload_size
id1755317
size37,441
張誌麟 (hsa00000)

documentation

README

mini_actor

The smallest, simplest Rust actor model built on Tokio runtime.

Features

  • Minimal trait-based design (Task)
  • Simple Actor that runs tasks on a Tokio runtime
  • Two modes: execute_waiting() and execute_detached()

Example

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;
Commit count: 0

cargo fmt