Long Lived Sessions - Thoughts

So I am trying to figure out the best way to do long lived sessions in a graceful way. My app will use WebSockets to send/receive data, but I want sessions to be active for many hours at a time. Obviously a regular alarm will keep the session active and happy on the Anvil side, but how can I ensure the WebSocket is persisted as long as possible (I’m using Hibernatable WebSockets with CloudFlare, so I want to avoid regular pings to the WS server, where possible), store websocket connection info, and react to disconnections/reconnections in a graceful way for the user. I am sure I could figure this out piece by piece, but just wanted to see if anyone has any specific knowledge in this area

2 Likes