1.0.4 • Published 5 years ago
@konper/easy-pool v1.0.4
Easy Pool
Create pool to limit the preemption of resource.
Install
npm
npm install @konper/easy-poolyarn
yarn add @konper/easy-poolUsage
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.