I'm working on a code that sends subscription messages from the browser to the server periodically, let's say in every 30 seconds.
The messages are generated by a coroutine, using delay to wait between messages.
The problem is that Safari and Chrome stops the coroutine after a minute or so if the browser is in the background or minimized.
As far as I know the solution would be web workers, but it would be very inconvenient to split the code because of this.
Any ideas / pointers which way should I go?