From 8d3df1df301a54522334d4f40f3064493c37cc35 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 9 Nov 2023 04:45:25 +0000 Subject: [PATCH] Auto-generated commit --- parallel/README.md | 24 ++++++++++++++++++------ parallel/examples/index.js | 2 +- parallel/examples/serial.js | 2 +- parallel/lib/node/worker/worker.js | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/parallel/README.md b/parallel/README.md index c04cfb68..8a069dc8 100644 --- a/parallel/README.md +++ b/parallel/README.md @@ -34,9 +34,11 @@ var parallel = require( '@stdlib/utils/parallel' ); Executes scripts in parallel. + + -```javascript +```text var files = [ './a.js', './b.js' @@ -66,9 +68,11 @@ The function accepts the following `options`: By default, the number of workers running scripts is equal to the number of CPUs minus `1` (master process). To adjust the number of workers, set the `workers` option. + + -```javascript +```text var files = [ './a.js', './b.js' @@ -92,9 +96,11 @@ parallel( files, opts, done ); By default, the number of scripts running concurrently is equal to the number of workers. To adjust the concurrency, set the `concurrency` option. + + -```javascript +```text var files = [ './a.js', './b.js' @@ -126,9 +132,11 @@ $ node To run scripts via an alternative executable or none at all, set the `cmd` option. + + -```javascript +```text var files = [ './a.js', './b.js' @@ -152,9 +160,11 @@ parallel( files, opts, done ); By default, the `stdio` output for each script is interleaved; i.e., the `stdio` output from one script **may** be interleaved with the `stdio` output from one or more other scripts. To preserve the `stdio` output order for each script, set the `ordered` option to `true`. + + -```javascript +```text var files = [ './a.js', './b.js' @@ -197,9 +207,11 @@ parallel( files, opts, done ); ## Examples + + - + diff --git a/parallel/examples/index.js b/parallel/examples/index.js index 81ab1ccb..447ee800 100644 --- a/parallel/examples/index.js +++ b/parallel/examples/index.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable no-sync */ +/* eslint-disable node/no-sync */ 'use strict'; diff --git a/parallel/examples/serial.js b/parallel/examples/serial.js index 6b6320ca..52bd29d4 100644 --- a/parallel/examples/serial.js +++ b/parallel/examples/serial.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable no-sync */ +/* eslint-disable node/no-sync */ 'use strict'; diff --git a/parallel/lib/node/worker/worker.js b/parallel/lib/node/worker/worker.js index 9a0864e5..e8f91484 100644 --- a/parallel/lib/node/worker/worker.js +++ b/parallel/lib/node/worker/worker.js @@ -56,7 +56,7 @@ function onMessage( message ) { debug( 'Environment configuration allows interleaved script output.' ); child = spawn( proc.env.WORKER_CMD, message, done ); } - db[ child.pid ] = true; + db[ child.pid ] = child; } /**