node-zookeeper-queue
FIFO queue using ZooKeeper, implemented with node.js streams
Download
The source is available for download from GitHub. Alternatively, you can install using Node Package Manager (npm):
npm install zookeeper-queue
Quick Example
This library exports two different stream constructors, depending on whether
you want publish or subscribe (write or read). Both streams follow the standard
stream interface for Writable or Readable with the addition of a destroy()
method on SubQueue to disconnect from ZooKeeper, which is done with the end()
method on PubQueue.
var zkQueue = ;var ZKPubQueue = zkQueuePubQueue; // Inherits from streams.Writablevar ZKSubQueue = zkQueueSubQueue; // Inherits from streams.Readable var options = path: '/myqueue' host: 'localhost' port: 2181 ; var subQueue = ; var pubQueue = options ;