1.1.0 • Published 7 years ago

joby v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

JOBY

Joby is a simple job queue backed by mongodb` native nodejs client that can be used with Meteor.

Joby work use later to manage recurring rule.

Joby is based on, based on https://github.com/scttnlsn/monq.

Install

npm install joby

Usage

var MongoClient = require('mongodb').MongoClient;
var Joby = require('joby');

var url = 'mongodb://localhost:27017/sample';

MongoClient.connect(url, function(err, db) {
  var collection = db.collection('jobs');
  var Queue = new Joby.Queue(collection, 'queue');
  var Worker = new Joby.Worker([Queue]);
  Worker.tasks({
    stuff: function(params, job) {
      // Doing stuff
      job.done();
      // job.failed();
    }
  });
  // Start polling
  Worker.start();

  // Add to queue
  Queue.enqueue('stuff', { foo: 'bar' }, function(err, job) {});
  Queue.enqueue('stuff', { foo: 'bar' }, { rule: 'every 30 minutes' }, function(err, job) {});
});
1.1.0

7 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago