@onesy/queue
v1.0.0
Published
Queue
Downloads
61
Maintainers
Readme
Getting started
Add
yarn add @onesy/queue
Use cases
- First come, first serve, use cases
- CPU Scheduling
- Memory management
- Website requests handling on the server
- Routers and switches in networking
- etc.
Use
import OnesyQueue from '@onesy/queue';
// Make a new queue instance
const onesyQueue = new OnesyQueue();
// Add values
onesyQueue.push(1, 2, 3, 4);
onesyQueue.first;
// 1
onesyQueue.length;
// 4
const value = onesyQueue.pop();
value;
// 1
onesyQueue.first;
// 2
onesyQueue.length;
// 3
Dev
Install
yarn
Test
yarn test
Prod
Build
yarn build