event v0.2.0 Event.Processor behaviour
Receives events from Event.Source or Event.Processor before passing them on to the next connected event handler(s)
Link to this section Summary
Functions
Asynchronously notify the processor that an event has occurred. Returns immediately.
Send a message to the event processor and await a response.
Send an asynchronous message to the event processor
Handle a code change
Handle a synchronous event notification
Handle an asynchronous event notification
Handle incoming events
Handle an incoming message
Handle a subscription
Initialize event processor state
Start an EventProcessor process.
Synchronously notify the processor that an event has occurred. This call will block until the event has been consumed, or until the timeout is reached
Handle process termination
Link to this section Types
from()
from() :: {pid(), subscription_tag()}
from() :: {pid(), subscription_tag()}
subscription_tag() (opaque)
Link to this section Functions
async_notify(processor, event)
Asynchronously notify the processor that an event has occurred. Returns immediately.
call(processor, call, timeout \\ 5000)
Send a message to the event processor and await a response.
cast(processor, cast)
Send an asynchronous message to the event processor
code_change(old_version, state, extra)
Handle a code change
handle_call(call, from, state)
Handle a synchronous event notification
handle_cast(call, state)
Handle an asynchronous event notification
handle_events(events, from, state)
Handle incoming events
handle_info(info, state)
Handle an incoming message
handle_subscribe(subscriber, opts, from, state)
Handle a subscription
init(opts)
Initialize event processor state
start_link(module, args, opts)
Start an EventProcessor process.
sync_notify(processor, event, timeout \\ 5000)
Synchronously notify the processor that an event has occurred. This call will block until the event has been consumed, or until the timeout is reached
terminate(reason, arg2)
Handle process termination
Link to this section Callbacks
code_change(old_vsn, state, extra) (optional)
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()
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()