I'm not seeing a good mechanism here to disconnect a consumer manually.
My use-case is this: a client will make a POST /some-route which kicks off a back-end service and allows other clients to watch for SSE on GET /events and I'm simply forwarding all output from the back-end service to the clients via es.SendMessage. I would like to close the SSE connections on those clients when the back-end service is finished.
Do you have any ideas?
"Hard" disconnecting should be used in exceptional cases (network error, killed process, etc).
I think in your use-case you can notify consumers (via SSE message) about the back-end service is stopping. So a consumer can disconnect itself.