React to client disconnection in request handler? #2912
Unanswered
cstrahan-blueshift
asked this question in
Q&A
Replies: 1 comment
-
The only way to detect a connection close is to actually write data into the socket and observe the outcome. So no if you block your handler for minutes you can't write anything to the socket. You want to make the process multi stage with at least two requests. One for submit and another for result. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Apologies if this is documented somewhere and I've just missed it, but:
Is there a way to check if a client has disconnected within a request handler?
I have a request handler that can take anywhere between 30 seconds to 2 minutes to process, and I would like to give up early if the client disconnects, but I haven't had any luck figuring out how I can do that in actix-web.
Any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions