Que v0.3.1 Que.QueueSet

Module to manage a QueueSet comprising of multiple Que.Queues, each for their respective Que.Worker.t.

Maintains a collection for Queues, one per Que.Worker, and provides wrappers around it for managing Jobs. Checks a given Que.Job’s type and off-loads the operation to the proper Queue and Worker pair.

There should be only one QueueSet per Que application. Meant for internal usage, so you shouldn’t use this unless you absolutely know what you’re doing.

Summary

Functions

Adds a Job to the appropriate Queue in a QueueSet

Groups a list of Jobs into a proper QueueSet. All Jobs are loaded only in the :queued list

Finds a Job in a QueueSet by the specified key-value pair

Finds the Queue for a specified worker. If the queue does not exist, returns a new Queue for that worker

Returns a new QueueSet with defaults

Calles :process on all Queues in QueueSet

Removes the specified job from the appropriate Queue’s running list

Finds a Job in the QueueSet by the given Job’s id and updates (replaces) it with the specified Job

Types

t()
t() :: %Que.QueueSet{queues: term}

A Que.QueueSet struct

Functions

add(qset, job)
add(queue_set :: Que.QueueSet.t, job :: Que.Job.t) :: Que.QueueSet.t

Adds a Job to the appropriate Queue in a QueueSet

collect(jobs)
collect(jobs :: [Que.Job.t]) :: Que.QueueSet.t

Groups a list of Jobs into a proper QueueSet. All Jobs are loaded only in the :queued list

find(queue_set, key \\ :id, value)
find(queue_set :: Que.QueueSet.t, key :: atom, value :: term) ::
  Que.Job.t |
  nil

Finds a Job in a QueueSet by the specified key-value pair.

If no key is specified, it’s assumed to be :id.

get(qset, worker)
get(queue_set :: Que.QueueSet.t, worker :: Que.Worker.t) :: Que.Queue.t

Finds the Queue for a specified worker. If the queue does not exist, returns a new Queue for that worker.

new()
new() :: Que.QueueSet.t

Returns a new QueueSet with defaults

process(qset)
process(queue_set :: Que.QueueSet.t) :: Que.QueueSet.t

Calles :process on all Queues in QueueSet

remove(qset, job)
remove(queue_set :: Que.QueueSet.t, job :: Que.Job.t) :: Que.QueueSet.t

Removes the specified job from the appropriate Queue’s running list

update(qset, job)
update(queue_set :: Que.QueueSet.t, job :: Que.Job.t) :: Que.QueueSet.t

Finds a Job in the QueueSet by the given Job’s id and updates (replaces) it with the specified Job