Skip to content

Instantly share code, notes, and snippets.

@dtipson
Last active December 26, 2023 15:08
Show Gist options
  • Select an option

  • Save dtipson/97feb25f851f204ea74b5bb04b02ed92 to your computer and use it in GitHub Desktop.

Select an option

Save dtipson/97feb25f851f204ea74b5bb04b02ed92 to your computer and use it in GitHub Desktop.

Revisions

  1. dtipson revised this gist Dec 26, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion complete-pipeline-two.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    const outputs = await pipe(
    testArrayGen,// generator of numbers
    postIds,// array of numbers, which is... already an iterable
    mapGen(fetchById),// generator of an array of eventually all resolved promises (requested in chunks of 3)
    chunkGen(5),// generator of arrays of 5 promises, our "batch"
    spreadBatchesAsyncGen,// async generator of individual resolved promises
  2. dtipson created this gist Dec 26, 2023.
    7 changes: 7 additions & 0 deletions complete-pipeline-two.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    const outputs = await pipe(
    testArrayGen,// generator of numbers
    mapGen(fetchById),// generator of an array of eventually all resolved promises (requested in chunks of 3)
    chunkGen(5),// generator of arrays of 5 promises, our "batch"
    spreadBatchesAsyncGen,// async generator of individual resolved promises
    forEachAsyncGen(renderPost)// Promise of an array of numbers
    )