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

Function slowSource

test/parallel/test-stream-iter-pipeto.js:94–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92 write(chunk) { chunks.push(chunk); },
93 };
94 async function* slowSource() {
95 yield [new TextEncoder().encode('a')];
96 await new Promise((r) => setTimeout(r, 50));
97 yield [new TextEncoder().encode('b')];
98 }
99 ac.abort();
100 await assert.rejects(
101 () => pipeTo(slowSource(), writer, { signal: ac.signal }),

Callers 1

testPipeToWithSignalFunction · 0.70

Calls 2

encodeMethod · 0.80
setTimeoutFunction · 0.50

Tested by

no test coverage detected