solid-queue

1.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i solid-queue

Weekly Downloads

1

Version

1.1.0

License

none

Last publish

Collaborators

  • tjholowaychuk