honeydew v1.0.0-rc1 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, must implement theGenStage.Dispatcher
behaviourfailure_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[]
.
For example:
Honeydew.queue_spec("my_awesome_queue")
Honeydew.queue_spec("my_awesome_queue", queue: {MyQueueModule, [ip: "localhost"]})
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.
For example:
Honeydew.worker_spec("my_awesome_queue", MyJobModule)
Honeydew.worker_spec("my_awesome_queue", {MyJobModule, [key: "secret key"]}, num: 3)