davinkevin / AngularStompDK

Angular service to communicate to Stomp-Websocket
http://davinkevin.github.io/AngularStompDK/
Apache License 2.0
36 stars 12 forks source link

Timeout Backoff Multiplier #32

Open ryanburr opened 8 years ago

ryanburr commented 8 years ago

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?

davinkevin commented 8 years ago

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 commented 8 years ago

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

GatoSnake commented 7 years ago

what is the status of this issue?

davinkevin commented 7 years ago

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