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. You can find the all the information in the documentation.

This actor system work under the following premises: - Simple: The API should be small, simple and intuitive. No surprises. - Fast: The system should be fast and use all available CPU cores. - Documented: Everything must be documented with exhaustive examples.

Regarding the implementation:

State of the implementation

The overall feature set is complete. Acteur will continue improving and adding improvements. As for now, this framework is actively supported/developed.

My main focus of work now is in the ergonomics.

Examples

Simple example

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

[derive(Debug)]

struct Employee { salary: u32 }

[async_trait]

impl Actor for Employee { type Id = u32; async fn activate(_: Self::Id, _: &Assistant) -> 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.sendtoactor_sync::(42, SalaryChanged(55000));

sys.waituntilstopped(); }

```

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.