Skip to content
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

doc: link cluster worker.send() to child.send() #839

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 6 additions & 4 deletions doc/api/cluster.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,13 @@ exit, the master may choose not to respawn a worker based on this value.
* `message` {Object}
* `sendHandle` {Handle object}

This function is equal to the send methods provided by
`child_process.fork()`. In the master you should use this function to
send a message to a specific worker.
Send a message to a worker or master, optionally with a handle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this kind of removes the general description of the function, I think it should have a general description too rather than only two separate ones


In a worker you can also use `process.send(message)`, it is the same function.
In the master this sends a message to a specific worker. It is identical to
[child.send()](child_process.html#child_process_child_send_message_sendhandle).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we link to a code'ified (with brackets)child.send()` rather than plaintext?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know, but I grepped, and there are no such examples of such markup in existing node docs, this link is in the same form as all other links: git grep '().*\].*html#' doc/api

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay


In a worker this sends a message to the master. It is identical to
`process.send()`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there anything that we can link process.send() to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. But that's a seperate problem.


This example will echo back all messages from the master:

Expand Down