How to handle server down and connection retries? #662
-
Does anyone have suggestions regarding what's the best way to handle your websocket server going down? Here's my current setup/scenario:
Feels like I'm doing something wrong here. How do I either stop the connection attempts entirely after a handful of failed attempts, or at a minimum, kill the old providers so that they stop attempting to connect when I'm no longer on that page/chapter? The providers onDestroy() callback fires... but the error messages for connection attempts continues. Any hints? Code looks like this:
And the useEffect:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
As of v2, you can instantiate the web socket connection separately from individual providers. Then you'll just have one connection with automatic retries as providers are created and destroyed. https://github.com/ueberdosis/hocuspocus/releases/tag/v2.0.0 |
Beta Was this translation helpful? Give feedback.
As of v2, you can instantiate the web socket connection separately from individual providers. Then you'll just have one connection with automatic retries as providers are created and destroyed.
https://github.com/ueberdosis/hocuspocus/releases/tag/v2.0.0