Skip to content

How do I handle disconnecting consumers manually? #6

jpfuentes2 opened this Issue Apr 1, 2013 · 2 comments

2 participants


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?

@antage antage was assigned Apr 1, 2013
antage commented Apr 2, 2013

"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.

@jpfuentes2 jpfuentes2 closed this Apr 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.