EventBus

class EventBus[A] extends EventSource[A] with Sink[A] with Named

EventBus combines a WriteBus and a stream of its events.

writer and events are made separate to allow you to manage permissions. For example, you can pass only the writer instance to a function that should only have access to writing events, not reading all events from the bus.

Companion:
object
trait Named
trait Sink[A]
trait EventSource[A]
trait Source[A]
class Object
trait Matchable
class Any

Value members

Concrete methods

def emit(event: A): Unit
def emitTry(event: Try[A]): Unit
override def toObservable: EventStream[A]
Definition Classes
override def toObserver: Observer[A]
Definition Classes

Inherited methods

protected def defaultDisplayName: String

This is the method that subclasses override to preserve the user's ability to set custom display names.

This is the method that subclasses override to preserve the user's ability to set custom display names.

Inherited from:
Named
final def displayName: String
Inherited from:
Named
def setDisplayName(name: String): Named.this.type

Set the display name for this instance (observable or observer).

Set the display name for this instance (observable or observer).

  • This method modifies the instance and returns this. It does not create a new instance.
  • New name you set will override the previous name, if any. This might change in the future. For the sake of sanity, don't call this more than once for the same instance.
  • If display name is set, toString will output it instead of the standard type@hashcode string
Inherited from:
Named
final override def toString: String

Override defaultDisplayName instead of this, if you need to.

Override defaultDisplayName instead of this, if you need to.

Definition Classes
Named -> Any
Inherited from:
Named

Concrete fields