https://github.com/myty/dispatch-queue
A dispatch queue built in Typescript with the ability to configure multiple queue processors.
https://github.com/myty/dispatch-queue
deno hacktoberfest typescript
Last synced: about 1 month ago
JSON representation
A dispatch queue built in Typescript with the ability to configure multiple queue processors.
- Host: GitHub
- URL: https://github.com/myty/dispatch-queue
- Owner: myty
- License: mit
- Created: 2022-10-01T19:13:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-11T01:15:29.000Z (over 3 years ago)
- Last Synced: 2026-03-28T01:37:42.761Z (3 months ago)
- Topics: deno, hacktoberfest, typescript
- Language: TypeScript
- Homepage:
- Size: 55.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DispatchQueue
[](https://github.com/myty/dispatch-queue)
[](https://deno.land/x/dispatch_queue)
[](https://www.npmjs.com/package/@myty/dispatch-queue)
[](https://coveralls.io/github/myty/dispatch-queue?branch=main)
A dispatch queue with the ability to configure multiple queue processors.
## Installation
### Node.js
```bash
# npm
npm install --save @myty/dispatch-queue
# yarn
yarn add @myty/dispatch-queue
# pnpm
pnpm install --save @myty/dispatch-queue
```
### Deno
```bash
import DispatchQueue from "https://deno.land/x/dispatch_queue/mod.ts";
```
## Example Usage
```typescript
const dispatcher = new DispatchQueue({
processor: (stringValue, workerId) => {
conosle.log(`Worker, '${workerId}', is processing: '${stringValue}'`);
},
});
dispatcher.process("test1");
// OUTPUT: "Worker, 'worker-1', is processing: 'test1'"
```