Skip to content

Commit 12fbac1

Browse files
cjihrigevanlucas
authored andcommitted
doc: fix cluster worker 'message' event
This commit adds the missing handle argument to the cluster worker 'message' event. It also adds a link to the process 'message' event for reference. Refs: #7297 PR-URL: #7309 Reviewed-By: Brian White <[email protected]>
1 parent 6dc0dae commit 12fbac1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/api/cluster.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ It is not emitted in the worker.
167167
### Event: 'message'
168168

169169
* `message` {Object}
170+
* `handle` {undefined|Object}
170171

171-
Similar to the `cluster.on('message')` event, but specific to this worker.
172-
173-
This event is the same as the one provided by [`child_process.fork()`][].
172+
Similar to the `cluster.on('message')` event, but specific to this worker. In a
173+
worker you can also use `process.on('message')`.
174174

175-
In a worker you can also use `process.on('message')`.
175+
See [`process` event: `'message'`][].
176176

177177
As an example, here is a cluster that keeps count of the number of requests
178178
in the master process using the message system:
@@ -735,3 +735,4 @@ socket.on('data', (id) => {
735735
[Child Process module]: child_process.html#child_process_child_process_fork_modulepath_args_options
736736
[child_process event: 'exit']: child_process.html#child_process_event_exit
737737
[child_process event: 'message']: child_process.html#child_process_event_message
738+
[`process` event: `'message'`]: process.html#process_event_message

0 commit comments

Comments
 (0)