MCPcopy
hub / github.com/redis/node-redis / destroy

Method destroy

packages/client/lib/client/index.ts:1859–1867  ·  view source on GitHub ↗

* Destroy the client. Rejects all commands immediately.

()

Source from the content-addressed store, hash-verified

1857 * Destroy the client. Rejects all commands immediately.
1858 */
1859 destroy() {
1860 clearTimeout(this._self.#pingTimer);
1861 this._self.#queue.flushAll(new DisconnectsClientError());
1862 this._self.#socket.destroy();
1863 this._self.#clientSideCache?.onClose();
1864 this._self.#unregisterFromMetrics();
1865 this._self.#credentialsSubscription?.dispose();
1866 this._self.#credentialsSubscription = null;
1867 }
1868
1869 ref() {
1870 this._self.#socket.ref();

Callers 1

disconnectMethod · 0.95

Calls 5

flushAllMethod · 0.80
disposeMethod · 0.80
destroyMethod · 0.65
onCloseMethod · 0.45

Tested by

no test coverage detected