View Source Datapio.MQ.Consumer behaviour (Datapio OpenCore v0.1.0)

Distributed queue consumer.

Link to this section Summary

Types

Consumer Identifier

Available consumer option

Consumer options

Functions

Return a specification to run the consumer under a supervisor

Shutdown the consumer

Start a consumer linked to the current process

Link to this section Types

Specs

consumer_id() :: atom() | String.t() | pos_integer()

Consumer Identifier

Specs

consumer_option() ::
  {:module, module()}
  | {:id, consumer_id()}
  | {:queue, String.t()}
  | {:data, any()}

Available consumer option

Specs

consumer_options() :: [consumer_option(), ...]

Consumer options

Link to this section Callbacks

Link to this callback

handle_message(term, term)

View Source

Specs

handle_message(term(), term()) :: :ack | :nack

Specs

handle_shutdown(term()) :: :ok

Link to this section Functions

Specs

Return a specification to run the consumer under a supervisor

Specs

shutdown(module(), consumer_id()) :: :ok

Shutdown the consumer

Specs

Start a consumer linked to the current process