Skip to content

Commit

Permalink
doc: linkify .fork() in cluster documentation
Browse files Browse the repository at this point in the history
PR-URL: #30163
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
addaleax authored and targos committed Nov 11, 2019
1 parent b654673 commit d7bfc6c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions doc/api/cluster.md
Expand Up @@ -531,7 +531,7 @@ added: v0.7.9


When any of the workers die the cluster module will emit the `'exit'` event. When any of the workers die the cluster module will emit the `'exit'` event.


This can be used to restart the worker by calling `.fork()` again. This can be used to restart the worker by calling [`.fork()`][] again.


```js ```js
cluster.on('exit', (worker, code, signal) => { cluster.on('exit', (worker, code, signal) => {
Expand Down Expand Up @@ -760,8 +760,8 @@ changes:
* `windowsHide` {boolean} Hide the forked processes console window that would * `windowsHide` {boolean} Hide the forked processes console window that would
normally be created on Windows systems. **Default:** `false`. normally be created on Windows systems. **Default:** `false`.


After calling `.setupMaster()` (or `.fork()`) this settings object will contain After calling [`.setupMaster()`][] (or [`.fork()`][]) this settings object will
the settings, including the default values. contain the settings, including the default values.


This object is not intended to be changed or set manually. This object is not intended to be changed or set manually.


Expand All @@ -779,11 +779,11 @@ changes:
`setupMaster` is used to change the default 'fork' behavior. Once called, `setupMaster` is used to change the default 'fork' behavior. Once called,
the settings will be present in `cluster.settings`. the settings will be present in `cluster.settings`.


Any settings changes only affect future calls to `.fork()` and have no Any settings changes only affect future calls to [`.fork()`][] and have no
effect on workers that are already running. effect on workers that are already running.


The only attribute of a worker that cannot be set via `.setupMaster()` is The only attribute of a worker that cannot be set via `.setupMaster()` is
the `env` passed to `.fork()`. the `env` passed to [`.fork()`][].


The defaults above apply to the first call only; the defaults for later The defaults above apply to the first call only; the defaults for later
calls are the current values at the time of `cluster.setupMaster()` is called. calls are the current values at the time of `cluster.setupMaster()` is called.
Expand Down Expand Up @@ -862,6 +862,8 @@ socket.on('data', (id) => {
}); });
``` ```


[`.fork()`]: #cluster_cluster_fork_env
[`.setupMaster()`]: #cluster_cluster_setupmaster_settings
[`ChildProcess.send()`]: child_process.html#child_process_subprocess_send_message_sendhandle_options_callback [`ChildProcess.send()`]: child_process.html#child_process_subprocess_send_message_sendhandle_options_callback
[`child_process.fork()`]: child_process.html#child_process_child_process_fork_modulepath_args_options [`child_process.fork()`]: child_process.html#child_process_child_process_fork_modulepath_args_options
[`child_process` event: `'exit'`]: child_process.html#child_process_event_exit [`child_process` event: `'exit'`]: child_process.html#child_process_event_exit
Expand Down

0 comments on commit d7bfc6c

Please sign in to comment.