Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 398 Bytes

README.md

File metadata and controls

39 lines (27 loc) · 398 Bytes

Easy Pool

Create pool to limit the preemption of resource.

Install

npm

npm install @konper/easy-pool

yarn

yarn add @konper/easy-pool

Usage

const foo = (cb) => {
  // touch resource here
  // ...
  // done
  cb()
}

const pool = new Pool([size = 5])
pool.push(foo)

Event

pool.on(event, callback)
  • done: triggered when size became 0.