@adobe/helix-shared-process-queue
TypeScript icon, indicating that this package has built-in type declarations

3.0.4 • Public • Published

Helix Shared - process queue

Usage

Process tasks concurrently:

const processQueue = require('@adobe/helix-shared-process-queue');

const tasks = [1, 2, 3];

const result = await processQueue(tasks, async (task) => {
  console.log(task);
  return someValue;
});

Access results during task

const processQueue = require('@adobe/helix-shared-process-queue');

const tasks = [1, 2, 3];

const result = await processQueue(tasks, async (task, queue, results) => {
  if (somecondition(results)) {
    // returning undefined does not add the return value to results
    return;
  }
  return someValue;
});

Readme

Keywords

none

Package Sidebar

Install

npm i @adobe/helix-shared-process-queue

Weekly Downloads

3,089

Version

3.0.4

License

Apache-2.0

Unpacked Size

26.9 kB

Total Files

6

Last publish

Collaborators

  • dylandepass
  • djaeggi
  • adobehalls
  • fullcolorcoder
  • marbec
  • tripod
  • garthdb
  • lazd
  • adobe-admin
  • patrickfulton
  • trieloff
  • shazron
  • krisnye
  • dcpfsdk
  • natebaldwin
  • devongovett
  • aspro83
  • symanovi
  • dpfister
  • stefan-guggisberg
  • korra
  • rofe
  • kptdobe