honeydew v1.0.0-rc6 Honeydew
Summary
Functions
Creates a supervision spec for a queue.
name
is how you’ll refer to the queue to add a task.
You can provide any of the following opts
:
queue
: is the module that queue will use, you may also provide init/1 args: {module, args}dispatcher
: the job dispatching strategy,{module, init_args}
.failure_mode
: the way that failed jobs should be handled. You can pass either a module, or {module, args}, the module must implement theHoneydew.FailureMode
behaviour.args
defaults to[]
.supervisor_opts
: options accepted bySupervisor.Spec.supervisor/3
.
For example:
Honeydew.queue_spec("my_awesome_queue")
Honeydew.queue_spec("my_awesome_queue", queue: {MyQueueModule, [ip: "localhost"]}, dispatcher: {Honeydew.Dispatcher.MRU, []})
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 init/1 args: {module, args}
You can provide any of the following opts
:
num
: the number of workers to startinit_retry
: the amount of time, in milliseconds, to wait before respawning a worker who’sinit/1
function failedshutdown
: if a worker is in the middle of a job, the amount of time, in milliseconds, to wait before brutally killing it.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)
For example:
Honeydew.worker_spec("my_awesome_queue", MyJobModule)
Honeydew.worker_spec("my_awesome_queue", {MyJobModule, [key: "secret key"]}, num: 3)
Honeydew.worker_spec({:global, "my_awesome_queue"}, MyJobModule, nodes: [:clientfacing@dax, :queue@dax])