fix(Shard): erroneously returning false

The node documentation fails to correctly document when the backlog of unsent messages exceeds a certain threshhold the function will return false. This does not mean it will refuse to send- simply that it will take time. Issue in point: https://github.com/nodejs/node/issues/7657#issuecomment-240581726
This commit is contained in:
Lewdcario
2018-06-04 18:01:10 -05:00
parent 0be0d2542d
commit 512af54e5d

View File

@@ -140,10 +140,9 @@ class Shard extends EventEmitter {
*/
send(message) {
return new Promise((resolve, reject) => {
const sent = this.process.send(message, err => {
this.process.send(message, err => {
if (err) reject(err); else resolve(this);
});
if (!sent) throw new Error('SHARDING_CHILD_CONNECTION');
});
}