long-emitter
v0.3.2
Published
A buffered EventEmitter with built in express middleware for long-polling.
Downloads
24
Maintainers
Readme
Node.js Long-Emitter
A buffered event emitter designed for use in simple long-polling event streaming from Node.js servers to web site front-ends, and managing delayed responses & timeouts.
#Installation
NPM: npm install long-emitter
##Example
See the example application for a basic use case.
##Basic Usage
var longEmitter = require('long-emitter');
var manager = longEmitter();
var emitter = manager.create();
emitter.emit('a');
emitter.emit('b', 2);
emitter.drain(function (events) {
// events -> [ ['a'], ['b', 2], ['c', 'hello'] ]
});
emitter.emit('c', 'hello');
emitter.release();
##Usage
Documentation to be written.