0.1.1 • Published 11 years ago

pika-queue v0.1.1

Weekly downloads
45
License
-
Repository
github
Last release
11 years ago

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"});
});
0.1.1

11 years ago

0.1.0

11 years ago

0.0.12

12 years ago

0.0.11

12 years ago

0.0.10

12 years ago

0.0.9

12 years ago

0.0.8

12 years ago

0.0.7

12 years ago

0.0.6

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago