[][src]Crate acteur

Acteur Actor System

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

Overall features of Acteur


use acteur::{Actor, Handle, Assistant, Acteur};
use async_trait::async_trait;

struct Employee {
    salary: u32

impl Actor for Employee {
    type Id = u32;

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

struct SalaryChanged(u32);

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

let sys = Acteur::new();

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




Acteur is the main inteface to the actor runtime. It allows sending messages, stopping the runtime, set configurations, etc. Once contructed with the method "new" you can start sending messages. The system will automatically start any required actor and unload them when not used.


This object is provided to the Handle method for each message that an Actor receives The Actor's assistant allows to send messages and to execute some task over the system.



The main Trait from this crate.


This Trait allow Actors to receive messages.