(proc, message, handle, cb)
| 14 | let seq = 0; |
| 15 | |
| 16 | function sendHelper(proc, message, handle, cb) { |
| 17 | if (!proc.connected) |
| 18 | return false; |
| 19 | |
| 20 | // Mark message as internal. See INTERNAL_PREFIX |
| 21 | // in lib/internal/child_process.js |
| 22 | message = { cmd: 'NODE_CLUSTER', ...message, seq }; |
| 23 | |
| 24 | if (typeof cb === 'function') |
| 25 | callbacks.set(seq, cb); |
| 26 | |
| 27 | seq += 1; |
| 28 | return proc.send(message, handle); |
| 29 | } |
| 30 | |
| 31 | // Returns an internalMessage listener that hands off normal messages |
| 32 | // to the callback but intercepts and redirects ACK messages. |
no test coverage detected
searching dependent graphs…