pika-queue

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

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.

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(errnotification) {
  // 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"});
var queueName = 'work-queue';
var worker = new PikaQueue();
 
worker.monitorJobQueue(queueName, function(jobnotificationFunc) {
  // Do some work... 
  notificationFunc({yourStatusMessage: "operation successful"});
});