generic-pool
Advanced tools
Comparing version 3.7.2 to 3.7.8
@@ -628,2 +628,22 @@ "use strict"; | ||
/** | ||
* Waits until the pool is ready. | ||
* We define ready by checking if the current resource number is at least | ||
* the minimum number defined. | ||
* @returns {Promise} that resolves when the minimum number is ready. | ||
*/ | ||
ready() { | ||
return new this._Promise(resolve => { | ||
const isReady = () => { | ||
if (this.available >= this.min) { | ||
resolve(); | ||
} else { | ||
setTimeout(isReady, 100); | ||
} | ||
}; | ||
isReady(); | ||
}); | ||
} | ||
/** | ||
* How many resources are available to allocated | ||
@@ -630,0 +650,0 @@ * (includes resources that have not been tested and may faul validation) |
{ | ||
"name": "generic-pool", | ||
"description": "Generic resource pooling for Node.JS", | ||
"version": "3.7.2", | ||
"version": "3.7.8", | ||
"author": "James Cooper <james@bitmechanic.com>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -235,2 +235,10 @@ [![build status](https://secure.travis-ci.org/coopernurse/node-pool.png)](http://travis-ci.org/coopernurse/node-pool) | ||
### pool.ready | ||
```js | ||
pool.ready() | ||
``` | ||
Waits for the pool to fully start. | ||
### pool.use | ||
@@ -237,0 +245,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
71286
1387
407
0