EventStore v1.0.2 EventStore.Registration behaviour View Source
Registration specification for EventStore pub/sub.
Link to this section Summary
Functions
Broadcasts message on given topic.
Return an optional supervisor spec for the registry.
Get the pub/sub registry configured for the given event store.
Subscribes the caller to the given topic.
Callbacks
Broadcasts message on given topic.
Return an optional supervisor spec for the registry.
Subscribes the caller to the given topic.
Link to this section Types
Link to this section Functions
Link to this function
broadcast(event_store, registry, topic, message)
View Sourcebroadcast(event_store(), registry(), binary(), term()) :: :ok | {:error, term()}
Broadcasts message on given topic.
Link to this function
child_spec(event_store, registry)
View Sourcechild_spec(event_store(), registry()) :: [:supervisor.child_spec()]
Return an optional supervisor spec for the registry.
Link to this function
registry(event_store, config)
View Sourceregistry(event_store(), config :: Keyword.t()) :: module()
Get the pub/sub registry configured for the given event store.
Link to this function
subscribe(event_store, registry, topic, opts \\ [])
View Sourcesubscribe(event_store(), registry(), binary(), selector: (EventStore.RecordedEvent.t() -> any()), mapper: (EventStore.RecordedEvent.t() -> any()) ) :: :ok | {:error, term()}
Subscribes the caller to the given topic.
Link to this section Callbacks
Link to this callback
broadcast(event_store, binary, term)
View Sourcebroadcast(event_store(), binary(), term()) :: :ok | {:error, term()}
Broadcasts message on given topic.
Link to this callback
child_spec(event_store)
View Sourcechild_spec(event_store()) :: [:supervisor.child_spec()]
Return an optional supervisor spec for the registry.
Link to this callback
subscribe(event_store, binary, list)
View Sourcesubscribe(event_store(), binary(), selector: (EventStore.RecordedEvent.t() -> any()), mapper: (EventStore.RecordedEvent.t() -> any()) ) :: :ok | {:error, term()}
Subscribes the caller to the given topic.