brook v0.1.1 Brook.Server

Process event messages to and from the underlying event stream message bus implementation. Interact with the application's persisted view state of the event stream with getter and setter functions to write and update events from the view state as well as delete them.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Return an value, stored under a given key for a given collection from the view state.

Return all values stored in the view state for a given collection. Values are returned as a map where the keys are the term used to store the value to the view state and the values are the data produced from event processing.

Returns a list of Brook events that produced the value saved under the given key within a collection from the application view state.

Initialize a Brook server configuration.

Start a Brook server and link it to the current process

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

get(collection, key)

Return an value, stored under a given key for a given collection from the view state.

Link to this function

get_all(collection)
get_all(Brook.view_collection()) ::
  {:ok, %{required(Brook.view_key()) => Brook.view_value()}}
  | {:error, Brook.reason()}

Return all values stored in the view state for a given collection. Values are returned as a map where the keys are the term used to store the value to the view state and the values are the data produced from event processing.

Link to this function

get_events(collection, key)
get_events(Brook.view_collection(), Brook.view_key()) ::
  {:ok, [Brook.Event.t()]} | {:error, Brook.reason()}

Returns a list of Brook events that produced the value saved under the given key within a collection from the application view state.

Link to this function

init(config)
init(term()) :: {:ok, term()}

Initialize a Brook server configuration.

Link to this function

start_link(config)
start_link(term()) :: {:ok, pid()}

Start a Brook server and link it to the current process