Skip to main content

spawn_with_options

Function spawn_with_options 

Source
pub fn spawn_with_options<T: Actor>(
    args: T::Args,
    opts: SpawnOptions,
) -> (ActorRef<T>, JoinHandle<ActorResult<T>>)
Expand description

Spawns a new actor with the given SpawnOptions and returns an ActorRef<T> along with a JoinHandle.

This is the most general spawn entry point. Use it when you need to enable the priority channel via SpawnOptions::with_priority or configure both mailbox capacity and priority in a single call.

ยงPanics

Panics if called outside a Tokio runtime context (this uses tokio::spawn).