Skip to content

How to manully close an EventStream #2810

Closed Answered by the10thWiz
RAPrograms asked this question in Questions
Discussion options

You must be logged in to vote

My understanding is that returning from the EventStream macro will close the stream once there is no more content to return. Is the client retrying the connection? Checking the MDN page (https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#closing_event_streams), the JS EventSource will automatically retry the connection if it gets dropped. Using EventStream!, an Event::retry can be sent to indicate how long the client should wait before attempting to reconnect, although there doesn't appear to be a way to prevent reconnection from the server side.

The likely solution for you is going to be to send a close event of some kind, indicating to the clien…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@RAPrograms
Comment options

@the10thWiz
Comment options

@RAPrograms
Comment options

Answer selected by RAPrograms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants