Function spawn_with_mailbox_capacity

Source
pub fn spawn_with_mailbox_capacity<T: Actor + MessageHandler + 'static>(
    actor: T,
    mailbox_capacity: usize,
) -> (ActorRef, JoinHandle<(T, ActorStopReason)>)
Expand description

Spawns a new actor with a specified mailbox capacity and returns an ActorRef to it, along with a JoinHandle.

The JoinHandle can be used to await the actor’s termination and retrieve the actor instance and its ActorStopReason.