final case class Subscribe[E](subscriber: ActorRef[E])(implicit classTag: ClassTag[E]) extends Command with Product with Serializable

Subscribe a typed actor to listen for types and subtypes of E by sending this command to the akka.actor.typed.ActorSystem.eventStream. The same actor can create multiple subscriptions for different types.

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)
Source
EventStream.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Subscribe
  2. Serializable
  3. Product
  4. Equals
  5. Command
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Subscribe(clazz: Class[E], subscriber: ActorRef[E])

    Java API.

  2. new Subscribe(subscriber: ActorRef[E])(implicit classTag: ClassTag[E])

Value Members

  1. def productElementNames: Iterator[String]
    Definition Classes
    Product
  2. val subscriber: ActorRef[E]