New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

object-pool-2

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-pool-2

A constructor specific object pool implementation for asynchronous recycling of object allocations.

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

Codeship Status for alexanderGugel/object-pool-2

object-pool-2

A constructor specific object pool implementation for asynchronous recycling of object allocations.

Installation

npm install object-pool-2 --save

Usage

var objectPool = require('object-pool-2')(Constructor);

Creates a new object pool. Accepts an Constructor which will be used internally in order to instantiate new Constructor instances (via new Constructor).

objectPool.allocate(callback)

Asynchronous. Allocates a new Constructor instance. This either results into a new instance being created or a previously deallocated instance being reused.

objectPool.deallocate()

Deallocates a allocated Constructor instance. This enables the object to be reused if needed.

objectPool.max = 10

Maximum number of internally managed Constructor instances. Defaults to 10. Will throw an error if max < inUse.

objectPool.available

Read-only. Number of available, but not necessarily allocated, Constructor instances.

objectPool.inUse

Read-only. Number of internally managed allocated (therefore not de-allocated) Constructor instances.

License

ISC

Keywords

object-pool

FAQs

Package last updated on 14 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts