Actify

Note that this crate is under construction. Although used in production, work is done on making an intuitive API, documententation and remaining features. For the time being, this does not follow semantic versioning!

Actify is an actor model built on Tokio that allows annotating any regular implementation block of your own type with the actify! macro.

Crates.io License Docs

Benefits

By generating the boilerplate code for you, a few key benefits are provided:

Example

Consider the following example, in which you want to turn your custom Greeter into an actor:

```rust,no_run use actify::{Handle, actify};

[derive(Clone, std::fmt::Debug)]

struct Greeter {}

[actify]

impl Greeter { fn say_hi(&self, name: String) -> String { format!("hi {}", name) } }

[tokio::main]

async fn main() { // An actify handle is created and initialized with the Greeter struct let handle = Handle::new_from(Greeter {});

// The sayhi method is made available on its handle through the actify! macro let greeting = handle.sayhi("Alfred".to_string()).await.unwrap();

// The method is executed remotely on the initialized Greeter and returned through the handle asserteq!(greeting, "hi Alfred".tostring()) } ```