A dispatch queue with the ability to configure multiple queue processors.
# npm
npm install --save @myty/dispatch-queue
# yarn
yarn add @myty/dispatch-queue
# pnpm
pnpm install --save @myty/dispatch-queue
import DispatchQueue from "https://deno.land/x/dispatch_queue/mod.ts";
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'"