closeio / socketshark

A WebSocket message router based on Python/Redis/asyncio
MIT License
116 stars 11 forks source link

Add subscription heartbeats #182

Closed nsaje closed 4 months ago

nsaje commented 4 months ago

While we do take many precautions we are still occasionally leaking connections - an example redeploy of Socketshark showed 10% of DMS subscriptions are stale (e.g. do not have a corresponding subscription in Socketshark), and that's on top of us deleting subscriptions after 7 days.

This PR introduces an optional heartbeat mechanism so that the service can keep track of heartbeats and do its own cleanup if it wants to.

nsaje commented 4 months ago

Will add some docs and release a new version once it's tested in production.