1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-08-26 03:06:07 +02:00
This commit is contained in:
Philipp Heckel 2022-03-11 15:17:12 -05:00
parent c124434429
commit 09336fa1e4
9 changed files with 32 additions and 33 deletions
web/src/app

View file

@ -2,6 +2,12 @@ import {basicAuth, encodeBase64Url, topicShortUrl, topicUrlWs} from "./utils";
const retryBackoffSeconds = [5, 10, 15, 20, 30];
/**
* A connection contains a single WebSocket connection for one topic. It handles its connection
* status itself, including reconnect attempts and backoff.
*
* Incoming messages and state changes are forwarded via listeners.
*/
class Connection {
constructor(connectionId, subscriptionId, baseUrl, topic, user, since, onNotification, onStateChanged) {
this.connectionId = connectionId;