Skip to content

Commit 782e702

Browse files
committed
doc: document the return value of {process,worker}.send()
Add documentation for the boolean value returned by process.send() and worker.send(). Fixes: nodejs#26995
1 parent 99268b1 commit 782e702

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

doc/api/cluster.md

+5
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,11 @@ if (cluster.isMaster) {
459459
}
460460
```
461461

462+
`worker.send()` will return `false` if the channel has closed or when the
463+
backlog of unsent messages exceeds a threshold that makes it unwise to send
464+
more. Otherwise, the method returns `true`. The `callback` function can be
465+
used to implement flow control.
466+
462467
## Event: 'disconnect'
463468
<!-- YAML
464469
added: v0.7.9

doc/api/process.md

+5
Original file line numberDiff line numberDiff line change
@@ -1840,6 +1840,11 @@ If Node.js was not spawned with an IPC channel, `process.send()` will be
18401840
The message goes through serialization and parsing. The resulting message might
18411841
not be the same as what is originally sent.
18421842

1843+
`process.send()` will return `false` if the channel has closed or when the
1844+
backlog of unsent messages exceeds a threshold that makes it unwise to send
1845+
more. Otherwise, the method returns `true`. The `callback` function can be
1846+
used to implement flow control.
1847+
18431848
## process.setegid(id)
18441849
<!-- YAML
18451850
added: v2.0.0

0 commit comments

Comments
 (0)