brook v0.6.0 Brook.Driver behaviour

Defines the behaviour clients must implement in order to send events to the event stream. Ensures a child specification is defined and a process can be started and linked to the calling process, as well as sending serialized events with an accompanying event type for pattern matching to handle different types of events from a single client event handling module.

Link to this section Summary

Types

Brook event message data encoded to a serialized format

Callbacks

Return a child specification for the Brook driver for inclusion in an application supervision tree.

Send a Brook event to the event stream with a contextual event type and a data value serialized for transfer.

Start a Brook driver and link to the current process.

Link to this section Types

Link to this type

serialized_event()

serialized_event() :: term()

Brook event message data encoded to a serialized format

Link to this section Callbacks

Link to this callback

child_spec(term)

child_spec(term()) :: Supervisor.child_spec()

Return a child specification for the Brook driver for inclusion in an application supervision tree.

Link to this callback

send_event(arg1, arg2, serialized_event)

send_event(Brook.instance(), Brook.event_type(), serialized_event()) ::
  :ok | {:error, Brook.reason()}

Send a Brook event to the event stream with a contextual event type and a data value serialized for transfer.

Link to this callback

start_link(list)

start_link([{:instance, Brook.instance()}]) :: GenServer.on_start()

Start a Brook driver and link to the current process.