A lightweight client-side priority job queue module (v0.90.30) that uses a real-time ticker (every 100ms) to evaluate and run the highest-priority job. Jobs are modeled with status transitions (queued → running → complete/idle) and emit events on change. Supports serial and parallel job groups, dynamic priority changes, and scheduled/recurring jobs. Designed for browserify but also works server-side. No recent releases or significant changes since initial version.
npm install priority-job-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a queue, adds a job with a simple function, starts the ticker, and stops after 500ms.
Create job with createJob() or new JobModel({description: '...'}) and then assign job.fn.Call queue.startRealTimeTicker() after adding jobs.
Always call callback(err, result) inside job.fn.
Use queue.remove() only on queued or idle jobs.
Use PriorityJobQueue.createInstance() instead of new PriorityJobQueue().
Use require('priority-job-queue').models.JobModel.Assign job.fn = function(opts, callback) { ... } before queue.add(job).No dependency data recorded yet.