1.0.0 • Published 5 years ago

@remvst/fixed-size-pool v1.0.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
5 years ago

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
1.0.0

5 years ago