hare v0.1.9 Hare.Context.Action behaviour
This module defines the behaviour all actions must implement to be run as a step in a context.
Default actions
The following common actions are implemented by default and can be referenced with an atom instead of the whole module name:
declare_exchange- (Action.DeclareExchange) declares an exchangeexchange- (Action.DeclareExchange) alias for:declare_exchangedefault_exchange- (Action.DefaultExchange) noop to produce the default exchangedelete_exchange- (Action.DeleteExchange) deletes an exchangedeclare_queue- (Action.DeclareQueue) declares a queuequeue- (Action.DeclareQueue) alias for:declare_queuedelete_queue- (Action.DeleteQueue) deletes a queuedeclare_server_named_queue - (Action.DeclareServerNamedQueue) declares a server-named queue *server_named_queue- (Action.DeclareServerNamedQueue) alias for:declare_server_named_queue*bind- (Action.Bind) binds a queue to an exchange *unbind- (Action.Unbind`) unbinds a queue from an exchange Check each action module for more information about its configuration format.
Summary
Types
The configuration of an action
A map containing the data exported from previously executed steps
Information about the execution of an action
Types
The configuration of an action
Callbacks
Runs the action.
It receives a open AMQP channel, the config of the action, and the exports map, containing data from previous run actions.
It may return 4 possible values:
:ok- On success (info is %{} by default){:ok, info}- On success, providing some info about the execution of the step{:ok, info, exports}- On success, providing some info, with a modified exports map{:error, reason}- On error
Validates the given config format.
It must return :ok if config is valid, and {:error, reason} if
it is invalid.