stompjs icon indicating copy to clipboard operation
stompjs copied to clipboard

Replaced ping setInterval integration with webworker

Open tomamatics opened this issue 1 year ago • 7 comments

The use of setInterval can be paused by the OS as soon as the browser tab or mobile browser app is in the background. Due to this behavior, the Stomp client library no longer sends ping messages and the Stomp server will close the connection. By using a webworker, the affected code will continue to run and ping-messages will be sent, even if the tab/app is not active.

tomamatics avatar Jul 30 '23 17:07 tomamatics

This does look interesting and useful. A couple of feedback:

  • Looking at the automated runs, this scheme does not work on NodeJS.
  • We can add checks if WebWorkers are available and use the new behavior accordingly.
  • In addition, we can introduce a flag to control this behavior.

Please only commit changes to the src folder. Makes it easier to review and compare.

kum-deepak avatar Jul 31 '23 01:07 kum-deepak

Many thanks! The code looks beautiful. Please allow me a few days to review this.

I may have a few suggestions - those will be optional. In addition, if possible, we should figure out to include it as part of the tests as well.

kum-deepak avatar Aug 03 '23 16:08 kum-deepak

Thanks for the review. Again, i fixed some minor issues. Tests should be running now.

tomamatics avatar Aug 04 '23 07:08 tomamatics

Will release as pert of v7.1

kum-deepak avatar Aug 17 '23 10:08 kum-deepak

Hi! sorry to ask, do you have an estimated ETA for v7.1? can't find that info, and this would be great to finally resolve the issue about timers throttled in chrome. Thanks!

drando avatar Sep 01 '23 13:09 drando

Hi, does anyone know when v7.1 will be released. Sorry if this question makes anyone uncomfortable. Greetings.

ianninirojas avatar Sep 07 '23 07:09 ianninirojas

Please refrain from asking for the release (and for anything else for that matter), as it will:

  1. Spam everybody's inbox that subscribed to this ticket
  2. Does not help in releasing this faster to the public
  3. Is straight up annoying

tschlechtweg avatar Sep 07 '23 07:09 tschlechtweg