adrian
A robust job queue system on top of mongodb.
Last updated 5 years ago by strathausen .
BSD · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install adrian 
SYNC missed versions from official npm registry.

Adrian

Robust and thorough job queue on top of MongoDB, featuring retries and timeouts.

Usage

var Queue = require('adrian');

var queue = new Queue('collection-name');

// Create job
var job = { some: 'data' };

// Enqueue job (and get a ticket ID)
queue.createJob(job, function(err, document) {
  // Job is in the queue.
  // Here's your ticket.
});

// Process job
queue.onJob(function(job, done) {
  // Crunch, crunch... your job processing goes here
  myJobProcessingLogic(job, function(err, result) {
    if (err) return done(err);
    // Must call done when finished
    done(null, result);
  });
});

Configuration

Adrian comes with a few options.

var queue = new Queue('collection-name', {options});

var defaults = {
  maxAttempts : 1,
  maxAge      : false, // maximum age of a job in seconds
  concurrency : 1,
  priority    : 1,
  polling     : 200
};

Similar projects

Current Tags

  • 0.0.1                                ...           latest (5 years ago)

1 Versions

  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (5)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |