MCPcopy
hub / github.com/slackapi/node-slack-sdk / stop

Method stop

packages/rtm-api/src/KeepAlive.ts:121–132  ·  view source on GitHub ↗

* Stop monitoring the RTMClient. This method should be called after the `recommend_reconnect` event is emitted and * the client's weboscket is closed. In order to start monitoring the client again, start() needs to be called again * after that.

()

Source from the content-addressed store, hash-verified

119 * after that.
120 */
121 public stop(): void {
122 this.logger.debug('stop monitoring');
123
124 this.clearPreviousPingTimer();
125 this.clearPreviousPongTimer();
126 if (this.client !== undefined) {
127 this.client.off('outgoing_message', this.setPingTimer);
128 this.client.off('slack_event', this.attemptAcknowledgePong);
129 }
130 this.lastPing = this.client = undefined;
131 this.recommendReconnect = this.isMonitoring = false;
132 }
133
134 /**
135 * Clears the ping timer if its set, otherwise this is a noop.

Callers 2

RTMClientClass · 0.45
constructorMethod · 0.45

Calls 3

debugMethod · 0.65

Tested by

no test coverage detected