isi-promise

1.0.0 • Public • Published

Promise extensions and helpers

Methods

contructur()

contructur(maxAmount, timeout, title, promiseLib)

Options:

  • maxAmount: used to set the amount of promise instances which can run at the same time
  • timeout: used to define an interval to retry get a new slot to run a promise
  • title: title of the promise helper instance. useful to identify the current instance
  • promiseLib: put in your favorite promise lib

description comes here

How to use()

reserveSemaphore() and resolveSemaphore()

Example:

var IsiPromiseCl = require('isi-promise');
var isiprom = new IsiPromiseCl(5, 50, );

for(var i = 0; i < 500; ++i){
    isiprom.reserveSemaphore()
    .then [... do your staff here ...]
    .then( isiprom.resolveSemaphore.bind(isiprom) );
}

Package Sidebar

Install

npm i isi-promise

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

2.27 kB

Total Files

3

Last publish

Collaborators

  • trexpert