baking-bad / pysignalr

Modern, reliable and async-ready client for SignalR protocol
MIT License
18 stars 6 forks source link

How can i reconnect if the connection is lost? #14

Open THE-KONDRAT opened 5 months ago

THE-KONDRAT commented 5 months ago

I use this library with blender bpy, and sometimes the rendering (which is a synchronous operation) exceeds the value of KeepAliveInterval. In this case, I want to try to restore the connection. What should i do?

olalid commented 5 months ago

In pyeasee I just put the code inside a try-except and a loop around it. So far that seems to work fine. See here: https://github.com/nordicopen/pyeasee/blob/bceeb06e05cbf13908cf6492667633ed0bf9c62d/pyeasee/easee.py#L284