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

Method start

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

* Start monitoring the RTMClient. This method should only be called after the client's websocket is already open.

(client: RTMClient)

Source from the content-addressed store, hash-verified

99 * Start monitoring the RTMClient. This method should only be called after the client's websocket is already open.
100 */
101 public start(client: RTMClient): void {
102 this.logger.debug('start monitoring');
103
104 if (!client.connected) {
105 const error = new Error('');
106 (error as CodedError).code = ErrorCode.KeepAliveClientNotConnected;
107 throw error;
108 }
109
110 this.client = client;
111 this.isMonitoring = true;
112 this.client.on('outgoing_message', this.setPingTimer, this);
113 this.setPingTimer();
114 }
115
116 /**
117 * Stop monitoring the RTMClient. This method should be called after the `recommend_reconnect` event is emitted and

Callers 1

taskMethod · 0.45

Calls 2

setPingTimerMethod · 0.95
debugMethod · 0.65

Tested by

no test coverage detected