View Source OddJob.Pool (OddJob v0.3.1)

The job pool that manages the assignments given to the pool workers.

Link to this section Summary

Types

t()

The OddJob.Pool struct holds the state of the job pool.

Link to this section Types

Specs

job() :: OddJob.Job.t()

Specs

t() :: %OddJob.Pool{
  assigned: [pid()],
  id: atom(),
  jobs: [job()],
  pool: atom(),
  workers: [pid()]
}

The OddJob.Pool struct holds the state of the job pool.

  • :id is an atom representing the registered name of the pool process
  • :pool is an atom representing the name of the job pool
  • :workers is a list of the active worker pids, whether they are busy working or not
  • :assigned is a list of the worker pids that are currently assigned to a job
  • :jobs is a list of OddJob.Job structs representing the jobs that are queued to be performed when workers are available