honeydew v1.1.5 Honeydew.Workers View Source
Link to this section Summary
Link to this section Types
Link to this section Functions
Creates a supervision spec for workers.
queue
is the name of the queue that the workers pull jobs from.
module
is the module that the workers in your queue will use. You may also
provide Honeydew.Worker.init/1
args with {module, args}
.
You can provide any of the following opts
:
num
: the number of workers to start. Defaults to10
.init_retry
: the amount of time, in seconds, to wait before respawning a worker whoseHoneydew.Worker.init/1
function failed. Defaults to5
.shutdown
: if a worker is in the middle of a job, the amount of time, in milliseconds, to wait before brutally killing it. Defaults to10_000
.supervisor_opts
options accepted bySupervisor.Spec.supervisor/3
.nodes
: for :global queues, you can provide a list of nodes to stay connected to (your queue node and enqueuing nodes). Defaults to[]
.
For example:
Honeydew.child_spec("my_awesome_queue", MyJobModule)
Honeydew.child_spec("my_awesome_queue", {MyJobModule, [key: "secret key"]}, num: 3)
Honeydew.child_spec({:global, "my_awesome_queue"}, MyJobModule, nodes: [:clientfacing@dax, :queue@dax])