MCPcopy Create free account
hub / github.com/nodejs/node / destroy

Function destroy

deps/undici/undici.js:1782–1799  ·  view source on GitHub ↗
(stream2, err)

Source from the content-addressed store, hash-verified

1780 }
1781 __name(isDestroyed, "isDestroyed");
1782 function destroy(stream2, err) {
1783 if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) {
1784 return;
1785 }
1786 if (typeof stream2.destroy === "function") {
1787 if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) {
1788 stream2.socket = null;
1789 }
1790 stream2.destroy(err);
1791 } else if (err) {
1792 queueMicrotask(() => {
1793 stream2.emit("error", err);
1794 });
1795 }
1796 if (stream2.destroyed !== true) {
1797 stream2[kDestroyed] = true;
1798 }
1799 }
1800 __name(destroy, "destroy");
1801 var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/;
1802 function parseKeepAliveTimeout(val) {

Callers 2

onConnectTimeoutFunction · 0.70
constructorMethod · 0.70

Calls 7

queueMicrotaskFunction · 0.85
isStreamFunction · 0.70
isDestroyedFunction · 0.70
abortMethod · 0.65
destroyMethod · 0.45
emitMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected