@myty/dispatch-queue
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

DispatchQueue

GitHub version deno land Coverage Status

A dispatch queue with the ability to configure multiple queue processors.

Installation

Node.js

# npm
npm install --save @myty/dispatch-queue
# yarn
yarn add @myty/dispatch-queue
# pnpm
pnpm install --save @myty/dispatch-queue

Deno

import DispatchQueue from "https://deno.land/x/dispatch_queue/mod.ts";

Example Usage

const dispatcher = new DispatchQueue<string>({
  processor: (stringValue, workerId) => {
    conosle.log(`Worker, '${workerId}', is processing: '${stringValue}'`);
  },
});

dispatcher.process("test1");
// OUTPUT: "Worker, 'worker-1', is processing: 'test1'"

/@myty/dispatch-queue/

    Package Sidebar

    Install

    npm i @myty/dispatch-queue

    Weekly Downloads

    14

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    20 kB

    Total Files

    29

    Last publish

    Collaborators

    • myty