[][src]Trait riker::actor::ActorRefFactory

pub trait ActorRefFactory {
    fn actor_of_props<A>(
        &self,
        name: &str,
        props: BoxActorProd<A>
    ) -> Result<ActorRef<A::Msg>, CreateError>
    where
        A: Actor
;
fn actor_of<A>(
        &self,
        name: &str
    ) -> Result<ActorRef<<A as Actor>::Msg>, CreateError>
    where
        A: ActorFactory + Actor
;
fn actor_of_args<A, Args>(
        &self,
        name: &str,
        args: Args
    ) -> Result<ActorRef<<A as Actor>::Msg>, CreateError>
    where
        Args: ActorArgs,
        A: ActorFactoryArgs<Args>
;
fn stop(&self, actor: impl ActorReference); }

Produces ActorRefs. actor_of blocks on the current thread until the actor has successfully started or failed to start.

It is advised to return from the actor's factory method quickly and handle any initialization in the actor's pre_start method, which is invoked after the ActorRef is returned.

Required methods

fn actor_of_props<A>(
    &self,
    name: &str,
    props: BoxActorProd<A>
) -> Result<ActorRef<A::Msg>, CreateError> where
    A: Actor

fn actor_of<A>(
    &self,
    name: &str
) -> Result<ActorRef<<A as Actor>::Msg>, CreateError> where
    A: ActorFactory + Actor

fn actor_of_args<A, Args>(
    &self,
    name: &str,
    args: Args
) -> Result<ActorRef<<A as Actor>::Msg>, CreateError> where
    Args: ActorArgs,
    A: ActorFactoryArgs<Args>, 

fn stop(&self, actor: impl ActorReference)

Loading content...

Implementors

impl ActorRefFactory for ActorSystem[src]

impl<'_> ActorRefFactory for &'_ ActorSystem[src]

impl<Msg: Message> ActorRefFactory for Context<Msg>[src]

Loading content...