OTP GenServer behavior and base implementation mirroring Python Kombu's
ConsumerMixin and ConsumerProducerMixin.
Provides:
- Connection management with automatic reconnection and backoff
- Lifecycle hooks (
on_connection_error,on_connection_revived,on_consume_ready,on_consume_end) - Integration with
Kombu.ConsumerandKombu.Producer - Safe message consumption in a supervised worker loop
Summary
Functions
Returns a specification to start this module under a supervisor.
Publishes a message using the server's producer (if producer is enabled).
Stops the consumer server gracefully.
Types
@type state() :: term()
Callbacks
@callback get_consumers(channel :: term(), state()) :: {[Kombu.Consumer.t()], state()} | [Kombu.Consumer.t()]
@callback on_consume_ready(consumers :: [Kombu.Consumer.t()], state()) :: state()
@callback on_decode_error(message :: Kombu.Message.t(), error :: term(), state()) :: state()
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec publish(GenServer.server(), term(), keyword()) :: term()
Publishes a message using the server's producer (if producer is enabled).
@spec start_link(module(), term(), keyword()) :: GenServer.on_start()
@spec stop(GenServer.server(), term(), timeout()) :: :ok
Stops the consumer server gracefully.