jobs-worker-queued
v0.0.5
Published
Jobs-Worker-Queued is a job runner for Node.js. It allows you to define and schedule jobs (arbitrary functions) for execution in a Nodejs worker node using the Rabbit MQ server.
Downloads
864
Readme
Jobs-Worker-Queued is a job runner for Node.js. It allows you to define and schedule jobs (arbitrary functions) for execution in a Nodejs worker node using the Rabbit MQ server.
Schema
Install
Run the follow command:
npm install --save jobs-worker-queued
Usage
Schedule a job
var JobManager = require("jobs-worker-queued");
var jobManager = new JobManager("amqp://YOUR_RABBIT_URI");
jobManager.publish(
{name: "job1", address: {city: "NY"}}
);
Run the jobs on the Worker
var JobManager = require("jobs-worker-queued");
var jobManager = new JobManager("amqp://YOUR_RABBIT_URI");
jobManager.run(function(data) {
console.log("run job here with payload", data)
});