Package org.apache.pekko.actor.typed
Class SpawnProtocol$
- java.lang.Object
-
- org.apache.pekko.actor.typed.SpawnProtocol$
-
public class SpawnProtocol$ extends java.lang.ObjectA message protocol for actors that support spawning a child actor when receiving aSpawnProtocol#Spawnmessage and sending back theActorRefof the child actor. Create instances through theSpawnProtocol.apply()orSpawnProtocol.create()factory methods.The typical usage of this is to use it as the guardian actor of the
ActorSystem, possibly combined withBehaviors.setupto starts some initial tasks or actors. Child actors can then be started from the outside by telling or askingSpawnProtocol#Spawnto the actor reference of the system. When usingaskthis is similar to howpekko.actor.ActorSystem#actorOfcan be used in classic actors with the difference that aFuture/CompletionStageof theActorRefis returned.Stopping children is done through specific support in the protocol of the children, or stopping the entire spawn protocol actor.
-
-
Field Summary
Fields Modifier and Type Field Description static SpawnProtocol$MODULE$Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description SpawnProtocol$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Behavior<SpawnProtocol.Command>apply()Scala API: returns a behavior that can be commanded to spawn arbitrary children.Behavior<SpawnProtocol.Command>create()Java API: returns a behavior that can be commanded to spawn arbitrary children.
-
-
-
Field Detail
-
MODULE$
public static final SpawnProtocol$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
create
public Behavior<SpawnProtocol.Command> create()
Java API: returns a behavior that can be commanded to spawn arbitrary children.
-
apply
public Behavior<SpawnProtocol.Command> apply()
Scala API: returns a behavior that can be commanded to spawn arbitrary children.
-
-