Pub/sub using Elixir's local Registry module.
Summary
Functions
Broadcasts message on given topic.
Return the child spec.
Subscribes the caller to the given topic.
Functions
@spec broadcast(Decree.Store.t(), binary(), term()) :: :ok
Broadcasts message on given topic.
@spec child_spec(Decree.Store.t()) :: [:supervisor.child_spec()]
Return the child spec.
@spec subscribe(Decree.Store.t(), binary(), selector: (Decree.Store.RecordedEvent.t() -> any()), mapper: (Decree.Store.RecordedEvent.t() -> any()), notices: boolean() ) :: :ok | {:error, term()}
Subscribes the caller to the given topic.
notices: true also sends the caller {:events_pending, event_number} when the publisher
stops a batch before an event whose type this instance does not know. A subscription
process registers with it; an aggregate or a transient subscriber does not.
The publisher cuts each notification's batch on its own: an event appended after the
unknown one, in a later append, is still broadcast. A subscriber without notices checks
stream_version or event_number continuity itself.