Hacker News new | ask | show | jobs
by melony 1279 days ago
Any exponential backoff in the event of unresponsive endpoint? How doea the library deal with increasing backpressure?
1 comments

There isn't any exponential backoff built-in, just the 500ms timeout in between fails. You can, however, set the number of retries to something you want your app to tolerate and then if it still fails, handle the error accordingly to pager duty or your own custom logic, etc.

Example w/ retries config: https://github.com/durkes/wubsub/blob/main/examples/client.j...

Regarding the backpressure for messages that the client is trying to publish while not connected, they will each be held in a setTimeout recursively until successful trying every 500ms also. If you build in your own custom receipt logic, this could be avoided. I considered building this in but wanted to keep it simple. Open to suggestions.