https://github.com/anmiles/queue
Queue dispatcher that sequentially processes incoming items
https://github.com/anmiles/queue
dispatcher enqueue javascript jest library nodejs queue typescript
Last synced: 5 months ago
JSON representation
Queue dispatcher that sequentially processes incoming items
- Host: GitHub
- URL: https://github.com/anmiles/queue
- Owner: anmiles
- License: mit
- Created: 2024-01-30T20:11:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-07-24T06:01:03.000Z (5 months ago)
- Last Synced: 2025-07-24T07:42:42.595Z (5 months ago)
- Topics: dispatcher, enqueue, javascript, jest, library, nodejs, queue, typescript
- Language: TypeScript
- Size: 2.39 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# @anmiles/queue
Queue dispatcher that sequentially processes incoming items
----
## Installation
`npm install @anmiles/queue`
## Usage
```js
import Queue from '@anmiles/queue';
const queue = new Queue([ item1, item2, item3 ], { interval: 500 });
queue.on('item', (item) => console.log('queue accessed this item in 500ms after previous one', item));
queue.on('done', () => console.log('queue finished'));
queue.dequeue();
/* after some time */
queue.enqueue([ item4, item5 ]);
/* queue automatically gets dequeued new items here */
```