View Source Elsa.Consumer.MessageHandler behaviour (Elsa.fi v2.0.2)

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 Callbacks

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

handle_messages(term, term)

View Source
@callback handle_messages(term(), term()) ::
  {:acknowledge, term()}
  | {:acknowledge, term(), term()}
  | {:ack, term()}
  | {:ack, term(), term()}
  | {:no_ack, term()}
  | {:noop, term()}
  | {:continue, term()}
@callback init(term()) :: {:ok, term()}

Link to this section Functions

Link to this macro

__using__(opts)

View Source (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.