brook v0.1.3 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
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
get(collection, key)
get(Brook.view_collection(), Brook.view_key()) ::
{:ok, Brook.view_value()} | {:error, Brook.reason()}
get(Brook.view_collection(), Brook.view_key()) :: {:ok, Brook.view_value()} | {:error, Brook.reason()}
Return an value, stored under a given key for a given collection from the view state.
get_all(collection)
get_all(Brook.view_collection()) ::
{:ok, %{required(Brook.view_key()) => Brook.view_value()}}
| {:error, Brook.reason()}
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.
get_events(collection, key)
get_events(Brook.view_collection(), Brook.view_key()) ::
{:ok, [Brook.Event.t()]} | {:error, Brook.reason()}
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.
init(config)
Initialize a Brook server configuration.
start_link(config)
Start a Brook server and link it to the current process