spawn_named

Function spawn_named 

Source
pub async fn spawn_named<T: Actor + Default>(
    name: ActorName,
    args: T::Arguments,
) -> Result<(ActorRef<T::Msg>, JoinHandle<()>), SpawnErr>
Expand description

Perform a background-spawn of an actor with the provided name. This is a utility wrapper over Actor::spawn which assumes the actor implementation implements Default.

  • name - The name for the actor to spawn
  • args - The arguments to start the actor

Returns [Ok((ActorRef, JoinHandle<()>))] upon successful actor startup, [Err(SpawnErr)] otherwise