event v0.1.0 Event.Sink behaviour

Final stage in an Event processing chain. Receives events from an Event.Source or Event.Processor and performs any final processing on them.

Link to this section Summary

Functions

Send a message to the event processor and await a response

Send an asynchronous message to the event processor

Handle a synchronous event notification

Handle an asynchronous event notification

Handle incoming events

Handle an incoming message

Initialize event processor state

Start an EventSink process

Handle process termination

Link to this section Types

Link to this type from()
from() :: {pid(), subscription_tag()}
Link to this opaque subscription_tag() (opaque)

Link to this section Functions

Link to this function call(processor, call, timeout \\ 5000)

Send a message to the event processor and await a response.

Link to this function cast(processor, cast)

Send an asynchronous message to the event processor

Link to this function code_change(old_version, state, extra)

Handle a code change

Link to this function handle_call(call, from, state)

Handle a synchronous event notification

Link to this function handle_cast(call, state)

Handle an asynchronous event notification

Link to this function handle_events(events, from, state)

Handle incoming events

Link to this function handle_info(info, state)

Handle an incoming message

Link to this function handle_subscribe(subscriber, opts, from, state)

Handle a subscription

Initialize event processor state

Link to this function start_link(module, args, opts)

Start an EventSink process.

Link to this function terminate(reason, map)

Handle process termination

Link to this section Callbacks

Link to this callback code_change(old_vsn, state, extra) (optional)
code_change(old_vsn, state :: term(), extra :: term()) ::
  {:ok, new_state :: term()} | {:error, reason :: term()}
when old_vsn: term() | {:down, term()}
Link to this callback handle_call(request, from, state) (optional)
handle_call(request :: term(), from :: GenServer.from(), state :: term()) ::
  {:reply, reply, new_state}
  | {:reply, reply, [event], new_state}
  | {:reply, reply, [event], new_state, :hibernate}
  | {:noreply, new_state}
  | {:noreply, [event], new_state}
  | {:noreply, [event], new_state, :hibernate}
  | {:stop, reason, reply, new_state}
  | {:stop, reason, new_state}
when reply: term(), new_state: term(), reason: term(), event: term()
Link to this callback handle_cast(request, state) (optional)
handle_cast(request :: term(), state :: term()) ::
  {:noreply, new_state}
  | {:noreply, [event], new_state}
  | {:noreply, [event], new_state, :hibernate}
  | {:stop, reason :: term(), new_state}
when new_state: term(), event: term()
Link to this callback handle_events(events, from, state) (optional)
handle_events(events :: [event], from(), state :: term()) ::
  {:noreply, new_state}
  | {:noreply, new_state, :hibernate}
  | {:stop, reason, new_state}
when new_state: term(), reason: term(), event: term()
Link to this callback handle_info(message, state) (optional)
handle_info(message :: term(), state :: term()) ::
  {:noreply, new_state}
  | {:noreply, [event], new_state}
  | {:noreply, [event], new_state, :hibernate}
  | {:stop, reason :: term(), new_state}
when new_state: term(), event: term()
Link to this callback terminate(reason, state) (optional)
terminate(reason, state :: term()) :: term()
when reason: :normal | :shutdown | {:shutdown, term()} | term()