CargueroTaskBunny.Worker (CargueroCargueroTaskBunny v0.0.8) View Source
A GenServer that listens a queue and consumes messages.
You don't have to call or start worker explicity. CargueroTaskBunny loads config and starts workers automatically for you.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Stops consuming messages from queue. Note this doesn't terminate the process and the jobs currently running will continue so.
Link to this section Types
Specs
t() :: %CargueroTaskBunny.Worker{
channel: AMQP.Channel.t() | nil,
concurrency: integer(),
consumer_tag: String.t() | nil,
host: atom(),
job_stats: %{failed: integer(), succeeded: integer(), rejected: integer()},
queue: String.t(),
runners: integer(),
store_rejected_jobs: boolean()
}
Struct that represents a state of the worker GenServer.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Specs
close_channel(AMQP.Channel.t() | nil) :: false | :ok | {:error, {:error, :blocked | :closing}}
Specs
stop_consumer(pid()) :: :ok
Stops consuming messages from queue. Note this doesn't terminate the process and the jobs currently running will continue so.