brook v0.6.0 Brook.Event.Handler behaviour

Defines the Brook.Event.Handler behaviour that an application is expected to provide for processing events off the event stream via Brook, as well as a default implementation.

Link to this section Summary

Types

The return value of a create operation to save a value to the view state

The return value of a delete operation to remove a value from the view state

The return value of an event that should not persist any result to the view state.

The return value of merging a new value into the existing value with the view state saved under a given key and collection.

Functions

Simple default handle_event/1 implementation that discards the message and takes no other action.

A using macro to define a module as implementing the Brook.Event.Handler behaviour and supply a default implementation of the required handle_event/1 function.

Callbacks

Process incoming events from the event stream and return a result with optional persistence of values to the application view state.

Link to this section Types

The return value of a create operation to save a value to the view state

Link to this type

delete()

delete() :: {:delete, Brook.view_collection(), Brook.view_key()}

The return value of a delete operation to remove a value from the view state

Link to this type

discard()

discard() :: :discard

The return value of an event that should not persist any result to the view state.

The return value of merging a new value into the existing value with the view state saved under a given key and collection.

Link to this section Functions

Link to this macro

__before_compile__(env)

(macro)

Simple default handle_event/1 implementation that discards the message and takes no other action.

Link to this macro

__using__(opts)

(macro)

A using macro to define a module as implementing the Brook.Event.Handler behaviour and supply a default implementation of the required handle_event/1 function.

Link to this section Callbacks

Link to this callback

handle_event(arg1)

handle_event(Brook.Event.t()) :: create() | delete() | merge() | discard()

Process incoming events from the event stream and return a result with optional persistence of values to the application view state.