interval-buffer-promisified
v0.0.3
Published
Interval Buffer for Node.js - Accumulate the messages in the buffer, and flushs for certain interval
Downloads
1
Readme
interval-buffer-promisified
Buffers the messages in certain interval as the buffer size allowed.
Install
Install with
npm install interval-buffer-promised --save
Usage
To get started, initialize a new instance with a messageHandler, which will be used to flush the messages after certain interval or when the buffer is full.
var intervalBuff = require('interval-buffer-promisified')({
messageHandler: log,
maxBufferSize: 126,
bufferFlushInterval: 500
})
To pass a message to the interval buffer
intervalBuff.send('sample message')