Std.App.Events
19 public declarations
- audience
&Std.App.Events.Bus -> Str -> Array[Str]The names of the subscribers an event on
topicreaches. - bus
Std.App.Events.BusA bus with no subscribers.
- Bus
Subscribers in the order they were added; delivery follows that order.
- deadOf
&Std.App.Events.Outbox -> Array[Std.App.Events.Event]Events that exhausted their attempts.
- Delivery
What one publish did: how many subscribers took the event, and which
- discard
&Std.App.Events.Outbox -> Std.App.Events.OutboxThe outbox with everything staged since the last drain discarded, as
- drain
&Std.App.Events.Outbox -> &Std.App.Events.Bus -> (Std.App.Events.Outbox, Std.App.Events.Delivery)Publishes every pending event in order after a commit.
- event
Str -> Str -> Int -> Std.Json.Json -> Std.App.Events.EventAn event.
- Event
Something that happened, named by a dotted topic such as
order.created. - fromJson
&Std.Json.Json -> Option[Std.App.Events.Event]An event read back from
toJson. - matches
Str -> Str -> BoolWhether
patternselectstopic. - outbox
Int -> Std.App.Events.OutboxAn empty outbox moving an event to
deadafterlimitfailed deliveries. - Outbox
Events staged inside a unit of work, delivered only after it commits.
- pendingOf
&Std.App.Events.Outbox -> Array[Std.App.Events.Event]Events awaiting delivery.
- publish
&Std.App.Events.Bus -> &Std.App.Events.Event -> Std.App.Events.DeliveryDelivers an event to every matching subscriber.
- stage
&Std.App.Events.Outbox -> Std.App.Events.Event -> Std.App.Events.OutboxThe outbox with one more event awaiting commit.
- Subscriber
A subscriber: the topic pattern it listens on, its name for reports, and
- Subscribing
Adding subscribers reads top to bottom:
Events.bus().on(...).on(...). - toJson
&Std.App.Events.Event -> Std.Json.JsonThe event as a JSON object, for a durable outbox table or a log line.
