porter v0.0.1 Porter.Notifier
A notifier that calls the provided callbacks belonging to each handler with an argument in the form of a tuple containing a status of either :ok
or :error
and a nested tuple containing either the atom :data
and some binary output or the atom :exit_status
and an exit code.
Summary
Functions
Invoked when the event manager passes an event to the handler. The callback provided to init/1
is then called passing in the event data as the argument
Initialize the Notifier handler by converting the callback in a list to a map
Start a GenEvent manager and returns its pid
Notify the specified event manager of an event
Add an event handler to the specified manager with a function to be called for each event
Functions
Specs
handle_event({atom, {atom, String.t | integer}}, term) :: {:ok, term}
Invoked when the event manager passes an event to the handler. The callback provided to init/1
is then called passing in the event data as the argument.
Specs
init([(... -> any)]) :: {:ok, %{callback: (... -> any)}}
Initialize the Notifier handler by converting the callback in a list to a map.
Specs
notify(pid :: pid, event :: {:ok, {atom, String.t | integer}} | {:error, {:exit_status, integer}}) :: :ok
Notify the specified event manager of an event.