Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I'm writing a client application that uses https://github.com/nanomsg/mangos to connect to a server using the PUB/SUB protocol. I'm not sure how to handle server or network interrupts on the client. The application is just a for loop waiting for a message to arrive and the call a go routine to handle that message. Does anybody know a good example how to deal with network or server failures in GO? Or should the application just panic and let the OS create a new instance of the application? The client application will run as a daemon so users can not interact with it.
Otherwise, did you check ie. https://github.com/googleapis/google-cloud-go/issues/1332 ?
As long as the pub/sub is an interface, you can create your own implementation that has reconnection and backoffs. I made my own http client that is a drop in replacement for the standard library http client with added methods for more features. https://github.com/madman22/shclisem as an example