Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samjoch/joby
Simple mongodb job queue, can be used with meteor with http://github.com/samjoch/joby-meteor.
https://github.com/samjoch/joby
javascript job-queue meteor mongodb
Last synced: 3 days ago
JSON representation
Simple mongodb job queue, can be used with meteor with http://github.com/samjoch/joby-meteor.
- Host: GitHub
- URL: https://github.com/samjoch/joby
- Owner: samjoch
- Created: 2015-06-18T10:53:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-29T23:11:38.000Z (almost 8 years ago)
- Last Synced: 2024-11-20T10:05:38.213Z (2 months ago)
- Topics: javascript, job-queue, meteor, mongodb
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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**
```bash
npm install joby
```**Usage**
```javascript
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) {});
});
```