go-sse icon indicating copy to clipboard operation
go-sse copied to clipboard

Fix panic on sse-server shutdown

Open hotafrika opened this issue 1 year ago • 1 comments

This is the fix for the "panic on sse-server shutdown when there is at least one active connection" issue. It does the following:

  1. after calling the Shutdown() function it doesn't allow new sse-connections to be established
  2. it avoids sending to already closed removeClient channel

hotafrika avatar Jun 15 '23 08:06 hotafrika

I've tested this forked version in an application utilising go-sse and can confirm it fixes the panic on shutdown

insano10 avatar Jun 15 '23 15:06 insano10