class EventStream extends LoggingBus with SubchannelClassification
An Akka EventStream is a pub-sub stream of events both system and user generated, where subscribers are ActorRefs and the channels are Classes and Events are any java.lang.Object. EventStreams employ SubchannelClassification, which means that if you listen to a Class, you'll receive any message that is of that type or a subtype.
The debug flag in the constructor toggles if operations on this EventStream should also be published as Debug-Events
- Source
- EventStream.scala
- Alphabetic
- By Inheritance
- EventStream
- SubchannelClassification
- LoggingBus
- ActorEventBus
- EventBus
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new EventStream(sys: ActorSystem)
- new EventStream(sys: ActorSystem, debug: Boolean)
Type Members
- type Classifier = Class[_]
- Definition Classes
- EventStream → LoggingBus → EventBus
- type Event = Any
- Definition Classes
- EventStream → LoggingBus → EventBus
- type Subscriber = ActorRef
- Definition Classes
- ActorEventBus → EventBus
Value Members
- def logLevel: LogLevel
Query currently set log level.
Query currently set log level. See object Logging for more information.
- Definition Classes
- LoggingBus
- def publish(event: Event): Unit
- Definition Classes
- SubchannelClassification
- def setLogLevel(level: LogLevel): Unit
Change log level: default loggers (i.e.
Change log level: default loggers (i.e. from configuration file) are subscribed/unsubscribed as necessary so that they listen to all levels which are at least as severe as the given one. See object Logging for more information.
NOTE: if the StandardOutLogger is configured also as normal logger, it will not participate in the automatic management of log level subscriptions!
- Definition Classes
- LoggingBus
- def startUnsubscriber(): Unit
Must be called after actor system is "ready".
Must be called after actor system is "ready". Starts system actor that takes care of unsubscribing subscribers that have terminated.
- def subscribe(subscriber: ActorRef, channel: Class[_]): Boolean
Subscribe an actor to listen for types and subtypes by passing Class to channel argument.
Subscribe an actor to listen for types and subtypes by passing Class to channel argument. The same actor can create multiple subscriptions for different Class.
- returns
true if successful and false if not (because it was already subscribed to that Classifier, or otherwise)
- Definition Classes
- EventStream → SubchannelClassification → EventBus
- def unsubscribe(subscriber: ActorRef): Unit
Unsubscribe all subscriptions created by this actor from the event stream.
Unsubscribe all subscriptions created by this actor from the event stream.
- Definition Classes
- EventStream → SubchannelClassification → EventBus
- def unsubscribe(subscriber: ActorRef, channel: Class[_]): Boolean
Unsubscribe specific types subscriptions created by this actor from the event stream.
Unsubscribe specific types subscriptions created by this actor from the event stream.
- returns
true if successful and false if not (because it wasn't subscribed to that Classifier, or otherwise)
- Definition Classes
- EventStream → SubchannelClassification → EventBus