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

Function testShareCancel

test/parallel/test-stream-iter-share-async.js:73–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71}
72
73async function testShareCancel() {
74 const shared = share(from('data'));
75 const consumer = shared.pull();
76
77 shared.cancel();
78 assert.strictEqual(shared.consumerCount, 0);
79
80 const batches = [];
81 for await (const batch of consumer) {
82 batches.push(batch);
83 }
84 assert.strictEqual(batches.length, 0);
85}
86
87async function testShareCancelMidIteration() {
88 // Verify that cancel during iteration stops data flow

Callers 1

Calls 5

shareFunction · 0.85
fromFunction · 0.50
pullMethod · 0.45
cancelMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…