Function spawn_with_mailbox_capacity

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

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

Takes initialization arguments that will be passed to the actor’s on_start method. The JoinHandle can be used to await the actor’s termination and retrieve the actor result as an ActorResult<T>. Use this version when you need to control the actor’s mailbox capacity.