generic-pool
Advanced tools
Comparing version 3.0.0-alpha to 3.0.0-alpha.1
@@ -63,2 +63,4 @@ 'use strict' | ||
* Should the pool start creating resources etc once the constructor is called | ||
* @param {Promise} [config.Promise=Promise] | ||
* What promise implementation should the pool use, defaults to native promises. | ||
*/ | ||
@@ -100,2 +102,4 @@ constructor (factory, config) { | ||
this._Promise = (typeof _config.Promise === 'object') ? _config.Promise : poolDefaults.Promise | ||
this._factory = factory | ||
@@ -446,3 +450,3 @@ this._draining = false | ||
if (this._draining) { | ||
return Promise.reject(new Error('pool is draining and cannot accept work')) | ||
return this._Promise.reject(new Error('pool is draining and cannot accept work')) | ||
} | ||
@@ -452,3 +456,3 @@ | ||
if (this._config.maxWaitingClients !== undefined && this._waitingClientsQueue.length >= this._config.maxWaitingClients) { | ||
return Promise.reject(new Error('max waitingClients count exceeded')) | ||
return this._Promise.reject(new Error('max waitingClients count exceeded')) | ||
} | ||
@@ -542,3 +546,3 @@ | ||
} | ||
return Promise.resolve() | ||
return this._Promise.resolve() | ||
} | ||
@@ -552,3 +556,3 @@ | ||
}) | ||
return Promise.all(ps) | ||
return this._Promise.all(ps) | ||
} | ||
@@ -571,3 +575,3 @@ | ||
this._availableObjects.forEach(this._destroy, this) | ||
return Promise.all(this._factoryDestroyOperations) | ||
return this._Promise.all(this._factoryDestroyOperations) | ||
} | ||
@@ -574,0 +578,0 @@ |
@@ -26,2 +26,4 @@ 'use strict' | ||
this.max = null | ||
// FIXME: this seems odd? | ||
this.Promise = Promise | ||
} | ||
@@ -28,0 +30,0 @@ } |
{ | ||
"name": "generic-pool", | ||
"description": "Generic resource pooling for Node.JS", | ||
"version": "3.0.0-alpha", | ||
"version": "3.0.0-alpha.1", | ||
"author": "James Cooper <james@bitmechanic.com>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -135,2 +135,3 @@ [![build status](https://secure.travis-ci.org/coopernurse/node-pool.png)](http://travis-ci.org/coopernurse/node-pool) | ||
- `autostart`: boolean, should the pool start creating resources etc once the constructor is called, (default true) | ||
- `Promise`: Promise lib, a Promises/A+ implementation that the pool should use. Defaults to whatever `global.Promise` is (usually native promises). | ||
@@ -137,0 +138,0 @@ ### pool.acquire |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
77591
1903
365
0