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

Function main

benchmark/webstreams/pipe-to.js:15–36  ·  view source on GitHub ↗
({ n, highWaterMarkR, highWaterMarkW })

Source from the content-addressed store, hash-verified

13
14
15async function main({ n, highWaterMarkR, highWaterMarkW }) {
16 const b = Buffer.alloc(1024);
17 let i = 0;
18 const rs = new ReadableStream({
19 highWaterMark: highWaterMarkR,
20 pull: function(controller) {
21 if (i++ < n) {
22 controller.enqueue(b);
23 } else {
24 controller.close();
25 }
26 },
27 });
28 const ws = new WritableStream({
29 highWaterMark: highWaterMarkW,
30 write(chunk, controller) {},
31 close() { bench.end(n); },
32 });
33
34 bench.start();
35 rs.pipeTo(ws);
36}

Callers

nothing calls this directly

Calls 5

pipeToMethod · 0.95
allocMethod · 0.80
closeMethod · 0.65
enqueueMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…