You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param {string[]} streams - An array of LDES streams to subscribe to, for real-time notifications.
11
11
* @memberof SubscribeNotification
12
12
*/
13
13
constructor(){
14
14
}
15
15
16
16
/**
17
17
* Subscribes to the notification server for each LDES stream in the constructor, using the inbox and subscription server.
18
+
* @param {string} ldes_stream - The LDES stream to subscribe to.
18
19
* @returns {(Promise<boolean | undefined>)} - Returns a promise with a boolean or undefined. If the subscription is successful, it returns true. If the subscription fails, it throws an error.
thrownewError("The subscription to the notification server failed.");
71
+
}
72
+
}
73
+
}
74
+
75
+
/**
76
+
* Checks if the LDES stream is already subscribed to the notification server.
77
+
* @param {string} ldes_stream - The LDES stream to check if it is already subscribed.
78
+
* @param {Map<string, WebSocket[]>} websocket_connections - The WebSocket connections.
79
+
* @returns {Promise<boolean>} - Returns a promise with a boolean. If the LDES stream is already subscribed, it returns true. If the LDES stream is not subscribed, it returns false.
* Sets the connections for the WebSocket server's Map.
93
+
* @param {string} ldes_stream - The LDES stream to subscribe to.
94
+
* @param {Map<string, WebSocket>} websocket_connections - The WebSocket connections.
95
+
* @returns {(Promise<WebSocket | undefined>)} - Returns a promise with a WebSocket or undefined. If the connection is set, it returns the WebSocket connection. If the connection is not set, it returns undefined.
0 commit comments