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

Method cancel

lib/internal/streams/iter/share.js:568–584  ·  view source on GitHub ↗
(reason)

Source from the content-addressed store, hash-verified

566 }
567
568 cancel(reason) {
569 if (this.#cancelled) return;
570 this.#cancelled = true;
571
572 if (reason !== undefined) {
573 this.#sourceError = reason;
574 }
575
576 if (this.#sourceIterator?.return) {
577 this.#sourceIterator.return();
578 }
579
580 for (const consumer of this.#consumers) {
581 consumer.detached = true;
582 }
583 this.#consumers.clear();
584 }
585
586 [SymbolDispose]() {
587 this.cancel();

Callers 1

[SymbolDispose]Method · 0.95

Calls 2

clearMethod · 0.65
returnMethod · 0.45

Tested by

no test coverage detected