Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.37 KB

README.md

File metadata and controls

46 lines (34 loc) · 1.37 KB

parallel-workers-manager

NPM version build status Test coverage npm download

Some tasks can easily be split

Installation

$ npm i parallel-workers-manager

Usage

import { ParallelWorkersManager } from 'parallel-workers-manager';

const manager = new ParallelWorkersManager(
  (value) => {
    return value;
  },
  {
    maxWorkers: 1,
  },
);

const promises = [manager.post('abc'), manager.post('def')];
const results = await Promise.all(promises);
expect(results).toEqual(['abc', 'def']);

License

MIT