spawn_named

Function spawn_named 

Source
pub async fn spawn_named<T>(
    name: String,
    args: <T as Actor>::Arguments,
) -> Result<(ActorRef<<T as Actor>::Msg>, JoinHandle<()>), SpawnErr>
where T: Actor + Default,
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