Topics

Spawning Actors

var pid1 = Actor.Spawn(props); // spawn an actor with an auto-generated namevar pid2 = Actor.SpawnPrefix(props, "prefix"); // spawn an actor with a prefix followed by an auto-generated namevar pid3 = Actor.SpawnNamed(props, "my-actor"); // spawn an actor with an exact name

If an actor already exists with the specified name, this will throw a ProcessNameExistException.

It is also possible for an actor to spawn a child actor that it will supervise (see Supervision for more details). To do this, instead use the spawn methods on the IContext from within the actor's Receive method: