elsa v0.12.3 Elsa.Consumer.MessageHandler behaviour

Define the behaviour and default implementations of functions for creating message handlers that will be called by Elsa worker processes.

Link to this section Summary

Functions

Defines the macro for implementing the message handler behaviour in an application. Default implementations allow injecting of configuration into the worker process, persisting state between runs of the message handler function, or alternatively, basic processing and acknowlegement of messages.

Link to this section Functions

Link to this macro

__using__(opts)

(macro)

Defines the macro for implementing the message handler behaviour in an application. Default implementations allow injecting of configuration into the worker process, persisting state between runs of the message handler function, or alternatively, basic processing and acknowlegement of messages.

Link to this section Callbacks

Link to this callback

handle_messages(term)

handle_messages(term()) ::
  :ack
  | :acknowledge
  | {:ack, term()}
  | {:acknowledge, term()}
  | :no_ack
  | :noop
  | :continue
Link to this callback

handle_messages(term, term)

handle_messages(term(), term()) ::
  {:acknowledge, term()}
  | {:acknowledge, term(), term()}
  | {:ack, term()}
  | {:ack, term(), term()}
  | {:no_ack, term()}
  | {:noop, term()}
  | {:continue, term()}
Link to this callback

init(term)

init(term()) :: {:ok, term()}