From 3e24a7b577b4088787f2ad1d297887d86ca2e9a3 Mon Sep 17 00:00:00 2001 From: Ernests Kuznecovs Date: Fri, 12 Jan 2024 12:32:49 +0100 Subject: [PATCH] Modify comment to reflect MultiSubscription --- .../src/Icepeak/Server/WebsocketServer/MultiSubscription.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/Icepeak/Server/WebsocketServer/MultiSubscription.hs b/server/src/Icepeak/Server/WebsocketServer/MultiSubscription.hs index 917f811..0af754a 100644 --- a/server/src/Icepeak/Server/WebsocketServer/MultiSubscription.hs +++ b/server/src/Icepeak/Server/WebsocketServer/MultiSubscription.hs @@ -363,8 +363,9 @@ handleClient conn core = do handleSubscriptionTimeout :: SubscriptionTimeout -> IO () handleSubscriptionTimeout _ = pure () - -- Put the client in the subscription tree and keep the connection open. - -- Remove it when the connection is closed. + -- Run the threads to propagate updates to client, and to receive and handle payloads + -- Upon threads dying, unsubscribe client from all subscriptions, then exit the procedure + -- to let `wai-websockets` close the websocket stream (since we are in a bracket) Exception.finally (onConnect client >> manageConnection) (onDisconnect client)