1.0.0 • Published 10 months ago

@onesy/queue v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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