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 2.0.4 to 2.1.0

10

lib/generic-pool.js

@@ -97,2 +97,4 @@ var PriorityQueue = function(size) {

* Should idle resources be destroyed and recreated every idleTimeoutMillis? Default: true.
* @param {Bool} [factory.returnToHead=false]
* Returns released object to head of available objects list
* @returns {Object} An Object pool that works with the supplied `factory`.

@@ -112,2 +114,3 @@ */

draining = false,
returnToHead = factory.returnToHead || false,

@@ -341,3 +344,8 @@ // Prepare a logger function.

var objWithTimeout = { obj: obj, timeout: (new Date().getTime() + idleTimeoutMillis) };
availableObjects.push(objWithTimeout);
if(returnToHead){
availableObjects.splice(0, 0, objWithTimeout);
}
else{
availableObjects.push(objWithTimeout);
}
log("timeout: " + objWithTimeout.timeout, 'verbose');

@@ -344,0 +352,0 @@ dispense();

8

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

@@ -11,3 +11,4 @@ "contributors": [

{ "name": "Tom MacWright", "url" : "http://www.developmentseed.org/" },
{ "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com", "url" : "http://somethingdoug.com/" }
{ "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com", "url" : "http://somethingdoug.com/" },
{ "name": "calibr"}
],

@@ -26,3 +27,4 @@ "keywords": ["pool", "pooling", "throttle"],

"test": "expresso -I lib test/*.js"
}
},
"license": "MIT"
}

@@ -23,2 +23,6 @@ [![build status](https://secure.travis-ci.org/coopernurse/node-pool.png)](http://travis-ci.org/coopernurse/node-pool)

2.1.0 - June 19 2014
- Merged #72 - Add optional returnToHead flag, if true, resources are returned to head of queue (stack like
behaviour) upon release (contributed by calibr), also see #68 for further discussion.
2.0.4 - July 27 2013

@@ -195,2 +199,4 @@ - Merged #64 - Fix for not removing idle objects (contributed by PiotrWpl)

reapIntervalMillis : frequency to check for idle resources (default 1000),
returnToHead : boolean, if true the most recently released resources will be the first to be allocated.
This in effect turns the pool's behaviour from a queue into a stack. optional (default false)
priorityRange : int between 1 and x - if set, borrowers can specify their

@@ -326,3 +332,3 @@ relative priority in the queue if no resources are available.

Copyright (c) 2010-2013 James Cooper &lt;james@bitmechanic.com&gt;
Copyright (c) 2010-2014 James Cooper &lt;james@bitmechanic.com&gt;

@@ -329,0 +335,0 @@ Permission is hereby granted, free of charge, to any person obtaining

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