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.0.0-alpha.3 to 3.0.0-alpha.4

6

lib/Pool.js

@@ -58,3 +58,3 @@ 'use strict'

* Should idle resources be destroyed and recreated every idleTimeoutMillis? Default: true.
* @param {Bool} [config.lifo=true]
* @param {Bool} [config.fifo=true]
* Sets whether the pool has LIFO (last in, first out) behaviour with respect to idle objects.

@@ -78,3 +78,3 @@ * if false then pool has FIFO behaviour

this._config.idleTimeoutMillis = _config.idleTimeoutMillis || poolDefaults.idleTimeoutMillis
this._config.lifo = (typeof _config.lifo === 'boolean') ? _config.lifo : poolDefaults.lifo
this._config.fifo = (typeof _config.fifo === 'boolean') ? _config.fifo : poolDefaults.fifo
this._config.refreshIdle = ('refreshIdle' in _config) ? _config.refreshIdle : poolDefaults.refreshIdle

@@ -524,3 +524,3 @@ this._config.reapInterval = _config.reapIntervalMillis || poolDefaults.reapIntervalMillis

_addPooledResourceToAvailableObjects (pooledResource) {
if (this._config.lifo === true) {
if (this._config.fifo === true) {
this._availableObjects.push(pooledResource)

@@ -527,0 +527,0 @@ } else {

@@ -10,3 +10,3 @@ 'use strict'

this.idleTimeoutMillis = 30000
this.lifo = true
this.fifo = true
this.refreshIdle = true

@@ -13,0 +13,0 @@ this.reapIntervalMillis = 1000

{
"name": "generic-pool",
"description": "Generic resource pooling for Node.JS",
"version": "3.0.0-alpha.3",
"version": "3.0.0-alpha.4",
"author": "James Cooper <james@bitmechanic.com>",

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

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

- `acquireTimeoutMillis`: max milliseconds an `acquire` call will wait for a resource before timing out. (default no limit), if supplied should non-zero positive integer.
- `lifo` : if true the oldest resources will be first to be allocated. If false 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. `boolean`, (default true)
- `fifo` : if true the oldest resources will be first to be allocated. If false 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. `boolean`, (default true)
- `priorityRange`: int between 1 and x - if set, borrowers can specify their relative priority in the queue if no resources are available.

@@ -134,0 +134,0 @@ see example. (default 1)

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