Socket
Socket
Sign inDemoInstall

generic-pool

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generic-pool - npm Package Compare versions

Comparing version 3.6.0 to 3.6.1

8

CHANGELOG.md
# Change Log
## [3.6.1] - Febuary 6 2019
- fix #251 - silence bluebird warning about side-effect only handler (@sandfox)
- Pool.clear no longer resolves to pointless array on undefineds (@restjohn)
## [3.6.0] - Febuary 4 2019

@@ -187,3 +191,5 @@ - update docs (@chdh)

[unreleased]: https://github.com/coopernurse/node-pool/compare/v3.5.0...HEAD
[unreleased]: https://github.com/coopernurse/node-pool/compare/v3.6.1...HEAD
[3.6.1]: https://github.com/coopernurse/node-pool/compare/v3.6.0...v3.6.1
[3.6.0]: https://github.com/coopernurse/node-pool/compare/v3.5.0...v3.6.0
[3.5.0]: https://github.com/coopernurse/node-pool/compare/v3.4.2...v3.5.0

@@ -190,0 +196,0 @@ [3.4.2]: https://github.com/coopernurse/node-pool/compare/v3.4.1...v3.4.2

@@ -320,2 +320,6 @@ "use strict";

this._dispense();
// Stop bluebird complaining about this side-effect only handler
// - a promise was created in a handler but was not returned from it
// https://goo.gl/rRqMUw
return null;
})

@@ -620,3 +624,3 @@ .catch(reason => {

).map(reflector);
return this._Promise.all(reflectedDestroyPromises);
return reflector(this._Promise.all(reflectedDestroyPromises));
});

@@ -623,0 +627,0 @@ }

2

package.json
{
"name": "generic-pool",
"description": "Generic resource pooling for Node.JS",
"version": "3.6.0",
"version": "3.6.1",
"author": "James Cooper <james@bitmechanic.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -260,2 +260,43 @@ "use strict";

tap.test("clear promise resolves with no value", function(t) {
let resources = [];
const factory = {
create: function create() {
return new Promise(function tryCreate(resolve, reject) {
let resource = resources.shift();
if (resource) {
resolve(resource);
} else {
process.nextTick(tryCreate.bind(this, resolve, reject));
}
});
},
destroy: function() {
return Promise.resolve();
}
};
const pool = createPool(factory, { max: 3, min: 3 });
Promise.all([pool.acquire(), pool.acquire(), pool.acquire()]).then(all => {
all.forEach(resource => {
process.nextTick(pool.release.bind(pool), resource);
});
});
t.equal(pool.pending, 3, "all acquisitions pending");
pool
.drain()
.then(() => pool.clear())
.then(resolved => {
t.equal(resolved, undefined, "clear promise resolves with no value");
t.end();
});
process.nextTick(() => {
resources.push("a");
resources.push("b");
resources.push("c");
});
});
tap.test("handle creation errors", function(t) {

@@ -262,0 +303,0 @@ let created = 0;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc