Bolt v0.1.9 Bolt.Queue View Source
Queue is the primary module to interact with the job queue.
Link to this section Summary
Functions
Checksout the next job from the queue if it exists. This will copy the job to the inprogress backup to protect against lost jobs
Enqueues a single job or list of jobs to the specified queue
Returns a running queue by name
Marks a job as finished. It will be removed from inprogress and its job data will be removed
initializes the queue by starting each of the schedulers defined in the config
Returns the worker module assigned in the config for a queue
Pulls all inprogress jobs for this queue back into the queue to be run immediately
Returns the list of schedulers
Sets the max worker count for the scheduler
Start a new Queue which can contain may schedulers
Returns a the status for each scheduler and its workers
Link to this section Functions
Checksout the next job from the queue if it exists. This will copy the job to the inprogress backup to protect against lost jobs.
Enqueues a single job or list of jobs to the specified queue.
Parameters
- queue_name: Atom name of the target queue.
- job_params | job_list: Map containing the job data or list of job maps.
Examples
# Add a single job to the :bg queue
iex> Bolt.enqueue(:bg, %{"somefield" => 1})
{:ok, [1, 1]}
# Add a collection of jobs to the :bg queue
iex> Bolt.enqueue(:bg, [%{"somefield" => 1}, %{"somefield" => 1}])
{:ok, [1, 1]}
Returns a running queue by name.
Marks a job as finished. It will be removed from inprogress and its job data will be removed.
initializes the queue by starting each of the schedulers defined in the config.
Returns the worker module assigned in the config for a queue.
Pulls all inprogress jobs for this queue back into the queue to be run immediately.
Returns the list of schedulers
Sets the max worker count for the scheduler.
Start a new Queue which can contain may schedulers
Returns a the status for each scheduler and its workers.