NAME

App::Netdisco::Backend::Queues

DESCRIPTION

The backend normally runs all jobs on one pool of workers (workers.tasks). The workers.queues setting reserves workers for particular actions, so that a long queue of one kind of job (say, discovery) cannot keep another (say, portcontrol) waiting for a free worker:

workers:
  tasks: 'AUTO * 2'
  queues:
    portcontrol:
      tasks: 2
      actions: [portcontrol, vlan]

An action named in a queue is run only by the workers of that queue, and the general pool never takes it. A queue without workers or actions is ignored, and its actions stay with the general pool.

EXPORT_OK

worker_queues

Returns a list of hash references, each with name, tasks (the number of workers), actions and only. The first is always the general pool, which lists the reserved actions it must leave alone (only false). The others are the reserved queues in name order, which list the actions they take (only true). Dies if an action is in more than one queue.

queue_for( \@queues, $action )

Returns the entry of @queues (as from worker_queues) which runs the given action. Actions not reserved go to the general pool, or if that has no workers, to the first reserved queue.

total_workers

The number of workers over all queues.