creates jobs and puts it on a reliable redis queue for workers
npm install redis-jobs
var redisjobs = require'redis-jobs';var queue = ;var job = queuecreateJobfoo: 'bar';jobon'timeout'console.log'request timed out on message bus';;jobon'reply'console.logres;;jobstart;//On worker dronevar worker = ;workeron'job'var res = jobdatafoo + 'baz';jobreplyres;;
Jobs are put onto a Redis List and popped off the list using BRPOPLPUSH; When a worker uses reply the message is deleted from the temporary work queue and sent over a publish message to the job requester. This allows jobs to queue up but the responses will be streamed back immediatly. Later releases will include a queue monitor interface to handle automatic load scaling.