Class SpawnProtocol.Spawn<T>

java.lang.Object
org.apache.pekko.actor.typed.SpawnProtocol.Spawn<T>
All Implemented Interfaces:
Serializable, SpawnProtocol.Command, scala.Equals, scala.Product
Enclosing class:
SpawnProtocol

public static final class SpawnProtocol.Spawn<T> extends Object implements SpawnProtocol.Command, scala.Product, Serializable
Spawn a child actor with the given behavior and send back the ActorRef of that child to the given replyTo destination.

If name is an empty string an anonymous actor (with automatically generated name) will be created.

If the name is already taken of an existing actor a unique name will be used by appending a suffix to the the name. The exact format or value of the suffix is an implementation detail that is undefined. This means that reusing the same name for several actors will not result in InvalidActorNameException, but it's better to use unique names to begin with.

See Also:
  • Constructor Details

  • Method Details

    • behavior

      public Behavior<T> behavior()
    • name

      public String name()
    • props

      public Props props()
    • replyTo

      public ActorRef<ActorRef<T>> replyTo()
    • copy

      public <T> SpawnProtocol.Spawn<T> copy(Behavior<T> behavior, String name, Props props, ActorRef<ActorRef<T>> replyTo)
    • copy$default$1

      public <T> Behavior<T> copy$default$1()
    • copy$default$2

      public <T> String copy$default$2()
    • copy$default$3

      public <T> Props copy$default$3()
    • copy$default$4

      public <T> ActorRef<ActorRef<T>> copy$default$4()
    • productPrefix

      public String productPrefix()
      Specified by:
      productPrefix in interface scala.Product
    • productArity

      public int productArity()
      Specified by:
      productArity in interface scala.Product
    • productElement

      public Object productElement(int x$1)
      Specified by:
      productElement in interface scala.Product
    • productIterator

      public scala.collection.Iterator<Object> productIterator()
      Specified by:
      productIterator in interface scala.Product
    • canEqual

      public boolean canEqual(Object x$1)
      Specified by:
      canEqual in interface scala.Equals
    • productElementName

      public String productElementName(int x$1)
      Specified by:
      productElementName in interface scala.Product
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object x$1)
      Specified by:
      equals in interface scala.Equals
      Overrides:
      equals in class Object