Class EventStream.Subscribe<E>
java.lang.Object
org.apache.pekko.actor.typed.eventstream.EventStream.Subscribe<E>
- All Implemented Interfaces:
Serializable,EventStream.Command,scala.Equals,scala.Product
- Enclosing class:
- EventStream
public static final class EventStream.Subscribe<E>
extends Object
implements EventStream.Command, scala.Product, Serializable
Subscribe a typed actor to listen for types or subtypes of E
by sending this command to the
pekko.actor.typed.ActorSystem.eventStream.
==Simple example==
sealed trait A
case object A1 extends A
//listen for all As
def subscribe(actorSystem: ActorSystem[_], actorRef: ActorRef[A]) =
actorSystem.eventStream ! EventStream.Subscribe(actorRef)
//listen for A1s only
def subscribe(actorSystem: ActorSystem[_], actorRef: ActorRef[A]) =
actorSystem.eventStream ! EventStream.Subscribe[A1](actorRef)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean<E> EventStream.Subscribe<E><E> ActorRef<E>booleaninthashCode()intproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
Subscribe
-
Subscribe
Java API.
-
-
Method Details
-
subscriber
-
copy
public <E> EventStream.Subscribe<E> copy(ActorRef<E> subscriber, scala.reflect.ClassTag<E> classTag) -
copy$default$1
-
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-