lightning-pool 4.3.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/pool.js +3 -13
- package/esm/pool.js +3 -13
- package/package.json +3 -2
package/cjs/pool.js
CHANGED
|
@@ -155,17 +155,7 @@ class Pool extends events_1.EventEmitter {
|
|
|
155
155
|
closeAsync(arg0) {
|
|
156
156
|
return putil_promisify_1.default.fromCallback(cb => this.close(arg0, cb));
|
|
157
157
|
}
|
|
158
|
-
acquire(
|
|
159
|
-
let callback;
|
|
160
|
-
let factoryCreateOptions;
|
|
161
|
-
if (typeof arg0 === 'function') {
|
|
162
|
-
callback = arg0;
|
|
163
|
-
}
|
|
164
|
-
else if (typeof arg0 === 'object') {
|
|
165
|
-
factoryCreateOptions = arg0;
|
|
166
|
-
if (typeof arg1 === 'function')
|
|
167
|
-
callback = arg1;
|
|
168
|
-
}
|
|
158
|
+
acquire(callback) {
|
|
169
159
|
if (!callback)
|
|
170
160
|
return putil_promisify_1.default.fromCallback(cb => this.acquire(cb));
|
|
171
161
|
try {
|
|
@@ -177,7 +167,7 @@ class Pool extends events_1.EventEmitter {
|
|
|
177
167
|
if (this.options.maxQueue && this.pending >= this.options.maxQueue) {
|
|
178
168
|
return callback(new Error('Pool queue is full'));
|
|
179
169
|
}
|
|
180
|
-
this._requestQueue.push(new pool_request_js_1.PoolRequest(this, callback
|
|
170
|
+
this._requestQueue.push(new pool_request_js_1.PoolRequest(this, callback));
|
|
181
171
|
this._processNextRequest();
|
|
182
172
|
}
|
|
183
173
|
/**
|
|
@@ -331,7 +321,7 @@ class Pool extends events_1.EventEmitter {
|
|
|
331
321
|
};
|
|
332
322
|
const tryCreate = () => {
|
|
333
323
|
try {
|
|
334
|
-
const o = this._factory.create({ tries, maxRetries }
|
|
324
|
+
const o = this._factory.create({ tries, maxRetries });
|
|
335
325
|
/* istanbul ignore next */
|
|
336
326
|
if (!o) {
|
|
337
327
|
return handleCallback(new abort_error_js_1.AbortError('Factory returned no resource'));
|
package/esm/pool.js
CHANGED
|
@@ -151,17 +151,7 @@ export class Pool extends EventEmitter {
|
|
|
151
151
|
closeAsync(arg0) {
|
|
152
152
|
return promisify.fromCallback(cb => this.close(arg0, cb));
|
|
153
153
|
}
|
|
154
|
-
acquire(
|
|
155
|
-
let callback;
|
|
156
|
-
let factoryCreateOptions;
|
|
157
|
-
if (typeof arg0 === 'function') {
|
|
158
|
-
callback = arg0;
|
|
159
|
-
}
|
|
160
|
-
else if (typeof arg0 === 'object') {
|
|
161
|
-
factoryCreateOptions = arg0;
|
|
162
|
-
if (typeof arg1 === 'function')
|
|
163
|
-
callback = arg1;
|
|
164
|
-
}
|
|
154
|
+
acquire(callback) {
|
|
165
155
|
if (!callback)
|
|
166
156
|
return promisify.fromCallback(cb => this.acquire(cb));
|
|
167
157
|
try {
|
|
@@ -173,7 +163,7 @@ export class Pool extends EventEmitter {
|
|
|
173
163
|
if (this.options.maxQueue && this.pending >= this.options.maxQueue) {
|
|
174
164
|
return callback(new Error('Pool queue is full'));
|
|
175
165
|
}
|
|
176
|
-
this._requestQueue.push(new PoolRequest(this, callback
|
|
166
|
+
this._requestQueue.push(new PoolRequest(this, callback));
|
|
177
167
|
this._processNextRequest();
|
|
178
168
|
}
|
|
179
169
|
/**
|
|
@@ -327,7 +317,7 @@ export class Pool extends EventEmitter {
|
|
|
327
317
|
};
|
|
328
318
|
const tryCreate = () => {
|
|
329
319
|
try {
|
|
330
|
-
const o = this._factory.create({ tries, maxRetries }
|
|
320
|
+
const o = this._factory.create({ tries, maxRetries });
|
|
331
321
|
/* istanbul ignore next */
|
|
332
322
|
if (!o) {
|
|
333
323
|
return handleCallback(new AbortError('Factory returned no resource'));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lightning-pool",
|
|
3
3
|
"description": "Fastest generic Pool written with TypeScript",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.4.1",
|
|
5
5
|
"author": "Panates Ltd.",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Eray Hanoglu <e.hanoglu@panates.com>"
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"doublylinked": "^2.5.4",
|
|
18
|
-
"putil-promisify": "^1.10.1"
|
|
18
|
+
"putil-promisify": "^1.10.1",
|
|
19
|
+
"tslib": "^2.6.3"
|
|
19
20
|
},
|
|
20
21
|
"type": "module",
|
|
21
22
|
"main": "./cjs/index.js",
|