You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the server is sending progress of a task, and it reaches 100%, how can the server close the connection to the client? I see there's ways for the client to close the connection but not sure how the server can do it with this package.
The text was updated successfully, but these errors were encountered:
Despite its name, the client object that you receive from the 'connection' event represents the SSE connection on the server side.
You can call client.close() to end the connection from the server.
Be aware that, due to how the EventSource work, the browser will attempt to reconnect some time after the connection has been closed. To prevent the browser from reconnecting, the server should end the response with a 204 status code. This is however not feasible in your case, because at the time you would cancel the connection the 200 status code would have been already sent to the client. If you want to prevent browser from reconnecting, you can set a very large retry value as a workaround.
If the server is sending progress of a task, and it reaches 100%, how can the server close the connection to the client? I see there's ways for the client to close the connection but not sure how the server can do it with this package.
The text was updated successfully, but these errors were encountered: