/rust-actor

A library to process closures enqueued asynchronous or synchronously waiting for its enqueued closure to be executed.

Primary LanguageRustBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Tideland Rust Actor

GitHub release GitHub license

Description

Tideland Rust Actor provides running backend Tokio threads for the sequential execution of closures following the actor model. It allows to do asynchronous and synchronous calls easily into an own context. The type actor.AsyncActor is simply processing the closure ony by one and this way removes the need for mutexes and channels. The actor.MultiActor is doing the same but allows to additionaly wait for the processing of a sent closure.

I hope you like it. ;)

Example

use actor::AsyncActor;

fn main() {
    let actor = AsyncActor::new();
    let _ = actor
        .send(|| {
            println!("Hello from actor!");
            Ok(())
        })
        .await;
}

Contributors