pq

pika-queue

PikaQueue provides a simple abstraction to managing job queues in redis.

Showing:

Popularity

Downloads/wk

22

Maintenance

No Maintenance Data Available

Package

Dependencies

4

Size (min+gzip)

15.4KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

PikaQueue

PikaQueue provides a simple abstraction to managing job queues in redis.

There are two players involved in a job queue: a producer and a worker.

A producer is an entity that submits a job to a queue to be completed. The producer may or may not be interested in being notified of the completion and status of job submitted.

A worker in an entity that monitors a job queue, processes the job, and then sends a notification to any interested parties once the completed.

Example of a producer:

var queueName = 'work-queue';
var producer = new PikaQueue();

// Pass in a callback if you wish to receive notification when the job is complete.
producer.queueJob(queueName, {data: "Job Data"}, function(err, notification) {
  // Do something with the notification
});

// If you do not wish to receive notification when the job is complete, simply omit the callback
producer.queueJob(queueName, {data: "Job Data"});

Example of a worker:

var queueName = 'work-queue';
var worker = new PikaQueue();

worker.monitorJobQueue(queueName, function(job, notificationFunc) {
  // Do some work...
  notificationFunc({yourStatusMessage: "operation successful"});
});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100