0.0.3 • Published 7 years ago

interval-buffer-promisified v0.0.3

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
7 years ago

interval-buffer-promisified

[Build Status][Coverage Status]Standard - JavaScript Style Guide

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')