Skip to content

Commit

Permalink
Document getSettings()
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfernandez committed May 12, 2024
1 parent 0929cc4 commit 9d60e38
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,45 @@ Spawn a new worker process.

This can only be called from the primary process.

## `cluster.getSettings()`

<!-- YAML
added: REPLACEME
-->

* Returns: {Object}
* `execArgv` {string\[]} List of string arguments passed to the Node.js
executable. **Default:** `process.execArgv`.
* `exec` {string} File path to worker file. **Default:** `process.argv[1]`.
* `args` {string\[]} String arguments passed to worker.
**Default:** `process.argv.slice(2)`.
* `cwd` {string} Current working directory of the worker process. **Default:**
`undefined` (inherits from parent process).
* `serialization` {string} Specify the kind of serialization used for sending
messages between processes. Possible values are `'json'` and `'advanced'`.
See [Advanced serialization for `child_process`][] for more details.
**Default:** `false`.
* `schedulingPolicy` {string} Scheduling policy to use between processes.
**Default:** `cluster.SCHED_RR`. See \[`cluster.schedulingPolicy`]\[] for
details.
* `silent` {boolean} Whether or not to send output to parent's stdio.
**Default:** `false`.
* `stdio` {Array} Configures the stdio of forked processes. Because the
cluster module relies on IPC to function, this configuration must contain an
`'ipc'` entry. When this option is provided, it overrides `silent`. See
[`child_process.spawn()`][]'s [`stdio`][].
* `uid` {number} Sets the user identity of the process. (See setuid(2).)
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
* `inspectPort` {number|Function} Sets inspector port of worker.
This can be a number, or a function that takes no arguments and returns a
number. By default each worker gets its own port, incremented from the
primary's `process.debugPort`.
* `windowsHide` {boolean} Hide the forked processes console window that would
normally be created on Windows systems. **Default:** `false`.

After calling [`.setupPrimary()`][] (or [`.fork()`][]) this function will return
the cluster settings, including the default values.

## `cluster.isMaster`

<!-- YAML
Expand Down

0 comments on commit 9d60e38

Please sign in to comment.