lightning-pool
Advanced tools
Comparing version 1.0.2 to 1.0.4
@@ -41,2 +41,3 @@ /* lightning-pool | ||
function Pool(factory, options) { | ||
EventEmitter.apply(this); | ||
if (typeof factory !== 'object') | ||
@@ -348,3 +349,3 @@ throw new TypeError('`factory` object required'); | ||
tries++; | ||
self._emitSafe('create-error', err, | ||
self._emitSafe('error', err, | ||
{ | ||
@@ -357,3 +358,3 @@ requestTime: request.created, | ||
self._creating--; | ||
return callback(err); | ||
return callback && callback(err); | ||
} | ||
@@ -445,3 +446,3 @@ return setTimeout(function() { | ||
if (self._allResources.size) | ||
/* Check again 5 ms later */ | ||
/* Check again 5 ms later */ | ||
setTimeout(function() { | ||
@@ -448,0 +449,0 @@ self._houseKeep(); |
{ | ||
"name": "lightning-pool", | ||
"description": "Fastest object pool implementation for JavaScript", | ||
"version": "1.0.2", | ||
"version": "1.0.4", | ||
"author": "Panates Ltd.", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -207,3 +207,3 @@ # lightning-pool | ||
- `max`: Maximum number of resources that `Pool` will create. (Default 10) | ||
- `maxQueue`: Maximum number of request that `Pool` will acceps. (Default 1000) | ||
- `maxQueue`: Maximum number of request that `Pool` will accept. (Default 1000) | ||
- `resetOnReturn`: If true `Pool` will call `reset()` function of factory before moving it idle state. (Default true) | ||
@@ -385,3 +385,3 @@ - `validation`: If true `Pool` will call `validation()` function of factory when it needs it. If false, `validation()` never been called. (Default true) | ||
- `pending` (Number): Returns number of acquire request waits in the `Pool` queue. | ||
- `size` (Number): Returns number total resources. | ||
- `size` (Number): Returns number of total resources. | ||
- `state` (PoolState): Returns current state of the `Pool`. | ||
@@ -388,0 +388,0 @@ - `options` (PoolOptions): Returns object instance that holds configuration properties |
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
36302
738