Skip to content

Commit

Permalink
Add todos for handshake timeout and ping-pong
Browse files Browse the repository at this point in the history
  • Loading branch information
platfowner committed Apr 15, 2024
1 parent bbf84cb commit a24b8f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/event-manager/event-channel-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default class EventChannelClient {
}

this._endpointUrl = url;
// TODO(platfowner): Add a custom handshake timeout.
this._ws = new WebSocket(url, [], { handshakeTimeout: connectionOption.handshakeTimeout || DEFAULT_HANDSHAKE_TIMEOUT_MS });
this._ws.onmessage = (event: { data: unknown }) => {
if (typeof event.data !== 'string') {
Expand All @@ -101,6 +102,7 @@ export default class EventChannelClient {
this.startHeartbeatTimer(connectionOption.heartbeatIntervalMs || DEFAULT_HEARTBEAT_INTERVAL_MS);
resolve(this);
};
// TODO(platfowner): Add a custom ping-poing for heartbeat.
// NOTE(jiyoung): implement onping method here.
// this._wsClient.on('ping', () => {
// if (this._heartbeatTimeout) {
Expand Down

0 comments on commit a24b8f4

Please sign in to comment.