From: Ardis Lu Date: Mon, 20 Jan 2025 07:26:04 +0000 (-0800) Subject: Use "concurrent" instead of "parallel" to avoid confusion with threads X-Git-Tag: v0.1.0~106 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=876298393f149d5a620592600c6249f48b54c200;p=csvio Use "concurrent" instead of "parallel" to avoid confusion with threads --- diff --git a/examples/ex8.js b/examples/ex8.js index a44f6be..f6b0e69 100644 --- a/examples/ex8.js +++ b/examples/ex8.js @@ -1,6 +1,6 @@ // ## Example 8: Processing rows concurrently (async) // -// Set the `maxConcurrent` option to a number greater than `1` to process rows in parallel. The transformation function +// Set the `maxConcurrent` option to a number greater than `1` to process rows concurrently. The transformation function // will be automatically turned into a promise if it isn't already async. // // Note that execution is blocked until all promises in a concurrent group settle. So if there is one transformation that @@ -18,7 +18,7 @@ function tick() { } let firstChunk = true; -async function parallel(row) { +async function concurrent(row) { if (firstChunk) { firstChunk = false; return ['tick number', ...row]; @@ -28,5 +28,5 @@ async function parallel(row) { } await new CSVReader(new URL('./data/ex8-in.csv', import.meta.url)) - .pipeThrough(new CSVTransformer(parallel, { includeHeaders: true, maxConcurrent: 5 })) + .pipeThrough(new CSVTransformer(concurrent, { includeHeaders: true, maxConcurrent: 5 })) .pipeTo(new CSVWriter(new URL('./data/ex8-out.csv', import.meta.url))); \ No newline at end of file