This package has been deprecated

Author message:

this package has been deprecated

@timvanscherpenzeel/object-pool

0.0.10 • Public • Published

Object-pool

npm version dependencies devDependencies

Object pool implementation using two circular linked lists.

Installation

$ npm install --save @timvanscherpenzeel/object-pool

Usage

$ npm run lint

$ npm run test

$ npm run test:coverage

$ npm run dist

$ npm run deploy
const ObjectPool = require('@timvanscherpenzeel/object-pool');

const objectPool = new ObjectPool({
  poolSize: 25,
});

const poolNode = objectPool.alloc();

poolNode.example = 'example property';

objectPool.free(poolNode);

poolNode = null;

API

objectPool.alloc()

  • Return Type: { key: string }

Allocates an object from the reservePool and puts it into the activePool. Returns the object and marks it with a unique key in order to be cleaned up later.

objectPool.free()

  • Return Type: void

Frees an object from the activePool, cleans up its properties and puts it into the reservePool.

Licence

My work is released under the MIT licence.

Readme

Keywords

none

Package Sidebar

Install

npm i @timvanscherpenzeel/object-pool

Weekly Downloads

2

Version

0.0.10

License

MIT

Unpacked Size

301 kB

Total Files

17

Last publish

Collaborators

  • timvanscherpenzeel