1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-08-20 08:24:02 +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

View file

@ -1,6 +1,12 @@
import Connection from "./Connection";
import {sha256} from "./utils";
/**
* The connection manager keeps track of active connections (WebSocket connections, see Connection).
*
* Its refresh() method reconciles state changes with the target state by closing/opening connections
* as required. This is done pretty much exactly the same way as in the Android app.
*/
class ConnectionManager {
constructor() {
this.connections = new Map(); // ConnectionId -> Connection (hash, see below)