tractor

Actor framework for Rust, modelled after Pony's actors:

Example

In Cargo.toml add tractor = "*" and tokio = "1.2.0".

```rust use tractor::*;

pub struct Adder { sum: usize, }

[actor]

impl Adder { fn inc(&mut self) { self.sum += 1; }

fn add(&mut self, num: usize) { self.sum += num; } }

[tokio::main]

async fn main() { let adder: Addr = Adder { sum: 0 }.start();

/// This sends the inc message to the actor. adder.inc();

/// This sends the add message to the actor. adder.add(42);

ActorSystem::waitforcompletion().await; } ```

More details