Acteur Actor System

A safe actor system written in Rust that just works. Simple, robust, fast, documented.


Crates.io version docs.rs docs

Main Features

Acteur uses async_std under the hood. This actor system work under the following premises:

Regarding the implementation:

State of the implementation

Examples

Simple example

```rust use acteur::{Acteur, Actor, Assistant, Receive}; use asynctrait::asynctrait;

[derive(Debug)]

struct Employee { salary: u32, }

[async_trait]

impl Actor for Employee { type Id = u32;

async fn activate(_: Self::Id) -> Self {
    Employee {
        salary: 0, //Load from DB or set a default,
    }
}

}

[derive(Debug)]

struct SalaryChanged(u32);

[async_trait]

impl Receive for Employee { async fn handle(&mut self, message: SalaryChanged, _: &Assistant) { self.salary = message.0; } }

fn main() { let sys = Acteur::new();

sys.send_sync::<Employee, SalaryChanged>(42, SalaryChanged(55000));

sys.wait_until_stopped();

} ```

You can find more examples in the examples folder.

Safe Rust

No unsafe code was directly used in this crate. You can check in lib.rs the #![deny(unsafe_code)] line.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.