MCPcopy
hub / github.com/redis/ioredis / disconnect

Function disconnect

lib/connectors/AbstractConnector.ts:22–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 }
21
22 disconnect(): void {
23 this.connecting = false;
24
25 if (this.stream) {
26 const stream = this.stream; // Make sure callbacks refer to the same instance
27
28 const timeout = setTimeout(() => {
29 debug(
30 "stream %s:%s still open, destroying it",
31 stream.remoteAddress,
32 stream.remotePort
33 );
34
35 stream.destroy();
36 }, this.disconnectTimeout);
37
38 stream.on("close", () => clearTimeout(timeout));
39 stream.end();
40 }
41 }
42
43 abstract connect(_: ErrorEmitter): Promise<NetStream>;
44}

Callers

nothing calls this directly

Calls 2

endMethod · 0.80
onMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…