Prioritized
Sometimes it is necessary to process jobs following a priority order. This is easily achieved by setting the "priority" option on the job payload.
The priorities range from 1
to 2 097 152.
Where the lowest value has the largest priority, following the same schema used by processes in Unix. A job without priority (or priority 0) will have the highest priority and be processed before any other prioritized job.
The JobOpts interface with the added priority option would look like this:
The above snippet will add one Job with priority 5, and another without priority. The job named "paint-black" even though it was added after the one called "paint-red" will be processed before, as jobs without priority will be processed before jobs with priority.
Last updated