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

Function setupMainThreadPort

lib/internal/worker/messaging.js:183–189  ·  view source on GitHub ↗
(port)

Source from the content-addressed store, hash-verified

181}
182
183function setupMainThreadPort(port) {
184 mainThreadPort = port;
185 mainThreadPort.on('message', handleMessageFromMainThread);
186
187 // Never block the process on this port
188 mainThreadPort.unref();
189}
190
191async function postMessageToThread(threadId, value, transferList, timeout) {
192 if (typeof transferList === 'number' && typeof timeout === 'undefined') {

Callers 1

worker_thread.jsFile · 0.85

Calls 2

onMethod · 0.45
unrefMethod · 0.45

Tested by

no test coverage detected