actix-telepathy 0.7.0

Cluster extension for the actix actor framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::{AddrRequest, AddrResolver, RemoteWrapper};
use actix::{Actor, Handler, Recipient, SystemService};

pub trait RemoteActor
where
    Self: Actor + Handler<RemoteWrapper>,
{
    const ACTOR_ID: &'static str;

    fn register(&mut self, rec: Recipient<RemoteWrapper>) {
        AddrResolver::from_registry()
            .do_send(AddrRequest::Register(rec, Self::ACTOR_ID.to_string()));
    }
}