@remvst/fixed-size-pool

1.0.0 • Public • Published

Fixed Size Pool

Can be used in cases where a pool with a fixed size is required and few memory allocations are executed.

The pool is backed by a single list whose size never varies.

Example Usage

const FixedSizePool = require('@remvst/fixed-size-pool');

const particlePool = new FixedSizePool(100);

// Insert values
particlePool.add(1);
particlePool.add(2);
particlePool.add(3);

// Dequeue particles
particlePool.remove(); // 1
particlePool.remove(); // 2
particlePool.remove(); // 3

Readme

Keywords

none

Package Sidebar

Install

npm i @remvst/fixed-size-pool

Weekly Downloads

1

Version

1.0.0

License

UNLICENSED

Unpacked Size

4.13 kB

Total Files

6

Last publish

Collaborators

  • remvst