How I pause a Server Sent Event connection? Is it even possible, or do I have to close the SSE and then reopen it and assign all of the event handlers again?
For example I would like to do (this is all theoretical, I do not know the pause/restart function names):
var source = new EventSource(url);
source.addEventListener("something", somefunction, false);
source.addEventListener("somethingElse", somefunction2, false);
//...some code
source.pause();
//...some code
source.restart();
Yes, that’s what technically needs to happen but you can abstract it away. Note: This one only connects after you do
.connect()Usage: