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 type

event_store()

View Source
event_store() :: module()
Link to this type

registry()

View Source
registry() :: module()

Link to this section Functions

Link to this function

broadcast(event_store, registry, topic, message)

View Source
broadcast(event_store(), registry(), binary(), term()) :: :ok | {:error, term()}

Broadcasts message on given topic.

Link to this function

child_spec(event_store, registry)

View Source
child_spec(event_store(), registry()) :: [:supervisor.child_spec()]

Return an optional supervisor spec for the registry.

Link to this function

registry(event_store, config)

View Source
registry(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 Source
subscribe(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 Source
broadcast(event_store(), binary(), term()) :: :ok | {:error, term()}

Broadcasts message on given topic.

Link to this callback

child_spec(event_store)

View Source
child_spec(event_store()) :: [:supervisor.child_spec()]

Return an optional supervisor spec for the registry.

Link to this callback

subscribe(event_store, binary, list)

View Source
subscribe(event_store(), binary(),
  selector: (EventStore.RecordedEvent.t() -> any()),
  mapper: (EventStore.RecordedEvent.t() -> any())
) :: :ok | {:error, term()}

Subscribes the caller to the given topic.