Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redis-jobs-ij

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-jobs-ij

redis-jobs ==========

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

redis-jobs

creates jobs and puts it on a reliable redis queue for workers

Build
Status

Basic Usage

npm install redis-jobs


var redisjobs = require('redis-jobs');
var queue = new redisjobs.Queue();

var job = queue.createJob({foo: 'bar'});

job.on('timeout', function(){
  console.log('request timed out on message bus');
});

job.on('reply', function(res){
 console.log(res);
});

job.start();



//On worker drone

var worker = new redisjobs.Worker();

worker.on('job', function(job){
  var res = job.data.foo + 'baz';
  job.reply(res);
});

worker.listen();

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.

FAQs

Package last updated on 29 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc