solid-queue

Solid CI job queue

npm install solid-queue
6 downloads in the last week
12 downloads in the last month

Solid queue

Redis-backed durable job queue for Solid CI.

API

Queue()

Initialize a new Queue.

Queue.clear(fn:Function)

Clear job queue data.

Queue.sub([fn]:Function)

Subscribe to events.

 var queue = new Queue;
 queue.sub();
 queue.on('push', function(job){})
 queue.on('complete', function(job){})

Events

  • push (job)
  • abort (job)
  • fail (job, err)
  • complete (job)
  • processing (job)

Queue.push(job:String, fn:Function)

Push job and invoke fn(err).

Queue.pop(fn:Function)

Perform a blocking pop to fetch a job and invoke fn(err, job).

Queue.fail(job:String, error:Error, [fn]:Function)

Abort job with the given error object.

Queue.abort(job:String, [fn]:Function)

Abort job.

Queue.complete(job:String, [fn]:Function)

Complete job.

Queue.stats(fn:Function)

Get queue statistics and invoke fn(err, stats).

  • total number of jobs total
  • count number of pending jobs
  • processing number of processing jobs

License

MIT

npm loves you