Class: JobQueueCapabilities

JobQueueCapabilities(capabilities, allowExclusiveJobsopt, capacityopt)

new JobQueueCapabilities(capabilities, allowExclusiveJobsopt, capacityopt)

Parameters:
Name Type Attributes Default Description
capabilities Number
allowExclusiveJobs Boolean <optional>
false Optional. Defaults to false. A boolean that indicates whether jobs that require the whole queue's capabilities are allowed on this queue. Such jobs have a cost equal to or higher than the queue's capabilities.
capacity Number <optional>
Optional. The maximum capacity of this JobQueue. Only has an effect if the chosen policy is not set to ignore excess items. The maximum capacity is the total amount of Jobs either currently running or in the backlog this JobQueue can accomodate.
Optional. JobQueueCapacityPolicy | Number The policy to use when the maximum capacity is reached, and new items are being enqueued.
Source:

Members

backlogCost :Number

Returns the total cost of all jobs that need to be run.
Type:
  • Number
Source:

capabilitiesFree :Number

Returns the remaining capabilities. Exclusive jobs may use more capabilities than this queue provides. However, this property can at minimum only return 0 (zero) (i.e. not negative values).
Type:
  • Number
Source:

capabilitiesUsed :Number

Return the accumulated cost of all currently running jobs.
Type:
  • Number
Source:

isBusy :Boolean

Only returns true, iff the remaining capabilities are exactly 0 (zero).
Type:
  • Boolean
Source:

load :Number

Returns a number that indicates the ratio between currently running and enqueued jobs and this queue's capabilities. 0 means that the queue is idle; a value close or equal to one means that the queue runs at or near its full capacity and a value greater than one means that there are exclusive jobs or a non-empty backlog of waiting jobs. Albeit overwritten, this property can be perfectly used to compare the load of parallel job queues.
Type:
  • Number
Source:

utilization :Number

Returns number indicating the utilization of this queue in terms of a ratio between used capabilities and available capabilities. Note that, if this queue allows exclusive jobs, the utilization may be greater than 100%. The range therefore is [0, infinity].
Type:
  • Number
Source:

Methods

addJob(job, costopt)

Parameters:
Name Type Attributes Description
job Job | producerHandler.<Promise.<T>>
cost Number <optional>
Source: