A selection represents part of the actor heirarchy, allowing messages to be sent to all actors in the selection.
There are several use cases where you would interact with actors via a selection instead of actor references:
- You know the path of an actor but you don't have its
- You want to broadcast a message to all actors within a path
ActorRef is almost always the better choice for actor interaction,
since messages are directly sent to the actor's mailbox without
any preprocessing or cloning.
ActorSelection provides flexibility for the cases where at runtime
ActorRefs can't be known. This comes at the cost of traversing
part of the actor heirarchy and cloning messages.
A selection is anchored to an
ActorRef and the path is relative
to that actor's path.
selection.tell results in the message being sent to zero actors,
the message is sent to dead letters.
impl<Msg: Message> ActorSelection<Msg>[src]
impl<Msg: Message> Tell for ActorSelection<Msg>[src]
type Msg = Msg
impl<Msg: Message> SysTell for ActorSelection<Msg>[src]
impl<Msg: Debug + Message> Debug for ActorSelection<Msg>[src]
type Error = Infallible
The type returned in the event of a conversion error.