1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
use crate::actors::props::Props;
use crate::actors::abstract_actor_ref::ActorRef;

//TODO docs
pub trait ActorRefFactory {
    fn actor_of(self: &mut Self, props: Props, name: Option<&str>) -> ActorRef;
    fn stop(self: &mut Self, aref: &mut ActorRef);
    fn dead_letters(self: &mut Self) -> ActorRef;

    /// Register watcher for receive 'watching events' from observed actor
    fn watch(&mut self, watcher: &ActorRef, observed: &ActorRef);

    /// Unregister watcher from receive 'watching events' from observed actor
    fn unwatch(&mut self, watcher: &ActorRef, observed: &ActorRef);
}