View Source OddJob.Queue (OddJob v0.5.1)
The OddJob.Queue is a GenServer that manages the assignments given to the pool workers.
The queue receives jobs and assigns them to available workers. If all workers in a pool are
currently busy then new jobs are added to a FIFO queue to be processed as workers
become available.
Link to this section Summary
Link to this section Types
Specs
job() :: OddJob.Job.t()
Specs
queue() :: {:via, Registry, {OddJob.Registry, {atom(), :queue}}}
Specs
The OddJob.Queue struct holds the state of the job queue.
:poolis a term representing the name of the job pool that thequeuebelongs to:workersis a list of the active workerpids, whether they are busy working or not:assignedis a list of the workerpids that are currently assigned to a job:jobsis a list ofOddJob.Jobstructs representing the jobs that are queued to be performed when workers are available
Specs
worker() :: pid()