AngularStompDK icon indicating copy to clipboard operation
AngularStompDK copied to clipboard

Timeout Backoff Multiplier

Open ryanburr opened this issue 8 years ago • 4 comments

I noticed that this library will try and reconnect indefinitely. My thought is that it would be nice to have a mechanisms to control how/when the service tries to reconnect, so I am suggesting this.

A timeout backoff multiplier + maximum timeout setting. This will increment the timeout value by the multiplier every time the service tries to reconnect. If it exceeds the maximum, it will use that. If it reconnects, it will default back to the original timeout for next time.

Thoughts?

ryanburr avatar Mar 09 '16 18:03 ryanburr

Really interesting.

It will be a real improvement. If some of you want to do a Pull Request about that, it will be welcomed.

Thanks for the proposal.

davinkevin avatar Mar 10 '16 04:03 davinkevin

We also can use the timeout and rely on the HTML5 API to know if the browser is offline to prevent any request :

  • https://developer.mozilla.org/en-US/docs/Online_and_offline_events
  • https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine

davinkevin avatar Apr 16 '16 18:04 davinkevin

what is the status of this issue?

GatoSnake avatar May 09 '17 20:05 GatoSnake

I haven't implemented and don't have time to do it 😢 , but PR are welcome, so don't hesitate...

davinkevin avatar May 11 '17 17:05 davinkevin