MCPcopy Index your code
hub / github.com/nodejs/node / checkForMessages

Function checkForMessages

lib/internal/modules/esm/worker.js:186–195  ·  view source on GitHub ↗

* Checks for messages on the syncCommPort and handles them asynchronously.

()

Source from the content-addressed store, hash-verified

184 * Checks for messages on the syncCommPort and handles them asynchronously.
185 */
186 function checkForMessages() {
187 immediate = setImmediate(checkForMessages).unref();
188 // We need to let the event loop tick a few times to give the main thread a chance to send
189 // follow-up messages.
190 const response = receiveMessageOnPort(syncCommPort);
191
192 if (response !== undefined) {
193 PromisePrototypeThen(handleMessage(response.message), undefined, errorHandler);
194 }
195 }
196
197 const unsettledResponsePorts = new SafeSet();
198

Callers 1

customizedModuleWorkerFunction · 0.85

Calls 4

receiveMessageOnPortFunction · 0.85
handleMessageFunction · 0.70
setImmediateFunction · 0.50
unrefMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…