* 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.
()
| 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. |
no test coverage detected