Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.
/ couch-queue Public archive

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

License

Notifications You must be signed in to change notification settings

CliffS/couch-queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published