@@ -50,8 +50,7 @@ Worker 6056 started
50
50
Worker 5644 started
51
51
```
52
52
53
- Please note that on Windows, it is not yet possible to set up a named pipe
54
- server in a worker.
53
+ On Windows, it is not yet possible to set up a named pipe server in a worker.
55
54
56
55
## How It Works
57
56
@@ -277,7 +276,7 @@ In the master, an internal message is sent to the worker causing it to call
277
276
278
277
Causes ` .exitedAfterDisconnect ` to be set.
279
278
280
- Note that after a server is closed, it will no longer accept new connections,
279
+ After a server is closed, it will no longer accept new connections,
281
280
but connections may be accepted by any other listening worker. Existing
282
281
connections will be allowed to close as usual. When no more connections exist,
283
282
see [ ` server.close() ` ] [ ] , the IPC channel to the worker will close allowing it
@@ -287,8 +286,8 @@ The above applies *only* to server connections, client connections are not
287
286
automatically closed by workers, and disconnect does not wait for them to close
288
287
before exiting.
289
288
290
- Note that in a worker, ` process.disconnect ` exists, but it is not this function,
291
- it is [ ` disconnect ` ] [ ] .
289
+ In a worker, ` process.disconnect ` exists, but it is not this function;
290
+ it is [ ` disconnect() ` ] [ ] .
292
291
293
292
Because long living server connections may block workers from disconnecting, it
294
293
may be useful to send a message, so application specific actions may be taken to
@@ -403,8 +402,8 @@ Causes `.exitedAfterDisconnect` to be set.
403
402
404
403
This method is aliased as ` worker.destroy() ` for backwards compatibility.
405
404
406
- Note that in a worker, ` process.kill() ` exists, but it is not this function,
407
- it is [ ` kill ` ] [ ] .
405
+ In a worker, ` process.kill() ` exists, but it is not this function;
406
+ it is [ ` kill() ` ] [ ] .
408
407
409
408
### worker.process
410
409
<!-- YAML
@@ -419,7 +418,7 @@ is stored.
419
418
420
419
See: [ Child Process module] [ ] .
421
420
422
- Note that workers will call ` process.exit(0) ` if the ` 'disconnect' ` event occurs
421
+ Workers will call ` process.exit(0) ` if the ` 'disconnect' ` event occurs
423
422
on ` process ` and ` .exitedAfterDisconnect ` is not ` true ` . This protects against
424
423
accidental disconnection.
425
424
@@ -758,14 +757,14 @@ changes:
758
757
` setupMaster ` is used to change the default 'fork' behavior. Once called,
759
758
the settings will be present in ` cluster.settings ` .
760
759
761
- Note that:
760
+ Any settings changes only affect future calls to ` .fork() ` and have no
761
+ effect on workers that are already running.
762
762
763
- * Any settings changes only affect future calls to ` .fork() ` and have no
764
- effect on workers that are already running.
765
- * The * only* attribute of a worker that cannot be set via ` .setupMaster() ` is
766
- the ` env ` passed to ` .fork() ` .
767
- * The defaults above apply to the first call only, the defaults for later
768
- calls is the current value at the time of ` cluster.setupMaster() ` is called.
763
+ The only attribute of a worker that cannot be set via ` .setupMaster() ` is
764
+ the ` env ` passed to ` .fork() ` .
765
+
766
+ The defaults above apply to the first call only; the defaults for later
767
+ calls are the current values at the time of ` cluster.setupMaster() ` is called.
769
768
770
769
``` js
771
770
const cluster = require (' cluster' );
@@ -846,8 +845,8 @@ socket.on('data', (id) => {
846
845
[ `child_process` event: `'exit'` ] : child_process.html#child_process_event_exit
847
846
[ `child_process` event: `'message'` ] : child_process.html#child_process_event_message
848
847
[ `cluster.settings` ] : #cluster_cluster_settings
849
- [ `disconnect` ] : child_process.html#child_process_subprocess_disconnect
850
- [ `kill` ] : process.html#process_process_kill_pid_signal
848
+ [ `disconnect() ` ] : child_process.html#child_process_subprocess_disconnect
849
+ [ `kill() ` ] : process.html#process_process_kill_pid_signal
851
850
[ `process` event: `'message'` ] : process.html#process_event_message
852
851
[ `server.close()` ] : net.html#net_event_close
853
852
[ `worker.exitedAfterDisconnect` ] : #cluster_worker_exitedafterdisconnect
0 commit comments