EventStream
Defined in: src/EventStream.ts:35
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new EventStream():
EventStream
Returns
Section titled “Returns”EventStream
Properties
Section titled “Properties”
optionallog?:EventStreamLogger
Defined in: src/EventStream.ts:44
Optional logger used to surface predicate failures. Assigned by
ActorSystem once its main logger has been constructed; tests
that instantiate EventStream directly can leave it undefined
— the bus stays functional, errors just stay silent.
Methods
Section titled “Methods”publish()
Section titled “publish()”publish(
event):void
Defined in: src/EventStream.ts:96
Publish an event to all matching subscribers.
Parameters
Section titled “Parameters”object
Returns
Section titled “Returns”void
subscribe()
Section titled “subscribe()”subscribe<
T>(subscriber,channel,predicate?):boolean
Defined in: src/EventStream.ts:57
Subscribe an actor ref to a channel (class). Returns true if a new subscription was added; false if a duplicate was rejected.
Dedup rules. Without predicate, only one subscription per
(subscriber, channel) is kept — re-calling subscribe is a
no-op. With a predicate, every call adds a new subscription:
predicates are values without an identity contract, so dedup’ing
across them would be unreliable; users wanting “replace this
filter” should unsubscribe first.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”subscriber
Section titled “subscriber”channel
Section titled “channel”Class<T>
predicate?
Section titled “predicate?”(event) => boolean
Returns
Section titled “Returns”boolean
unsubscribe()
Section titled “unsubscribe()”unsubscribe<
T>(subscriber,channel?):boolean
Defined in: src/EventStream.ts:83
Unsubscribe a (subscriber, channel) pair, or every subscription
the actor holds when channel is omitted. Removes ALL matching
entries — including predicate-bearing ones; finer-grained removal
(one specific predicate at a time) isn’t supported because
predicates have no stable identity.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”subscriber
Section titled “subscriber”channel?
Section titled “channel?”Class<T>
Returns
Section titled “Returns”boolean