job manager with concurrency and prioritization
A job handler with concurrency and prioritization.
var jobs = require'jobs'jobsconcurrency = 5cojobspush'task1id' task1jobspush'task2id' task2var result1 = yield jobsawait'task1id'
Create a new jobs instance. Options:
Set the concurrency of the jobs.
Push a job to be run.
fn- currently jobs must be a thunk.
id- a unique job id as a string. Defaults to a random string.
priority: 0- a priority as a number.
Await the result of an event. All job ids are emitted as events. There are additionally these events:
drain- when there are no more jobs to run
If a job by
id exists, sets its priority to