Skip to content

Commit

Permalink
doc: remove incorrect and outdated example
Browse files Browse the repository at this point in the history
PR-URL: #30138
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
tniessen authored and targos committed Oct 28, 2019
1 parent 3c23224 commit e4ab6fc
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -613,24 +613,6 @@ Emitted when the cluster master receives a message from any worker.

See [`child_process` event: `'message'`][].

Before Node.js v6.0, this event emitted only the message and the handle,
but not the worker object, contrary to what the documentation stated.

If support for older versions is required but a worker object is not
required, it is possible to work around the discrepancy by checking the
number of arguments:

```js
cluster.on('message', (worker, message, handle) => {
if (arguments.length === 2) {
handle = message;
message = worker;
worker = undefined;
}
// ...
});
```

## Event: 'online'
<!-- YAML
added: v0.7.0
Expand Down

0 comments on commit e4ab6fc

Please sign in to comment.