Skip to content

doc: fix cluster worker 'message' event #7309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ It is not emitted in the worker.
### Event: 'message'

* `message` {Object}
* `handle` {undefined|Object}

Similar to the `cluster.on('message')` event, but specific to this worker.

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

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

As an example, here is a cluster that keeps count of the number of requests
in the master process using the message system:
Expand Down Expand Up @@ -735,3 +735,4 @@ socket.on('data', (id) => {
[Child Process module]: 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: 'message']: child_process.html#child_process_event_message
[`process` event: `'message'`]: process.html#process_event_message