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

Function newCrossRealmReadableStream

lib/internal/webstreams/transfer.js:274–288  ·  view source on GitHub ↗
(writable, port)

Source from the content-addressed store, hash-verified

272}
273
274function newCrossRealmReadableStream(writable, port) {
275 // MessagePort should always be unref.
276 // There is a problem with the process not terminating.
277 // https://github.com/nodejs/node/issues/44985
278 const readable = new ReadableStream(new CrossRealmTransformReadableSource(port, false));
279
280 const promise = readableStreamPipeTo(readable, writable, false, false, false);
281
282 setPromiseHandled(promise);
283
284 return {
285 readable,
286 promise,
287 };
288}
289
290function newCrossRealmWritableSink(readable, port) {
291 // MessagePort should always be unref.

Callers

nothing calls this directly

Calls 2

readableStreamPipeToFunction · 0.85
setPromiseHandledFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…