0.5.2 • Published 6 years ago

couch-queue v0.5.2

Weekly downloads
11
License
ISC
Repository
github
Last release
6 years ago

couch-queue

Safe, concurrent queuing allowing multiple writers and multiple workers using CouchDB as its backend.

The principal difference from other, similar modules is that this will wait for another entry to become available, if the queue is exhausted.

Example

static Queue = require('couch-queue');

static queue = new Queue(undefined, undefined, {
  username: 'cliff',
  password: 'pass'
});
queue.on('ready', function() {
  queue.createQueue();
})
.on('dequeued', function(data) {
  console.log("Dequeued payload " + JSON.stringify(data, null, 2));
});
.on('created', function() {
  var payload = {
    anything: "you like",
    canGo: "in here"
  }
  queue.enqueue(payload);
})




## Database Fields
* pending: boolean
* enqueued: time pushed
* dequeued: time pulled

## Installation

    npm install couch-queue

## Events

    ready

Emitted by the contructor
0.5.2

6 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago