-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to detect client disconnection #2190
Comments
This PR added ability to check the connection state in case we have access to http request object. |
|
You can still use HttpRequestPtr |
@nqf even if you can check connection status the way you described, we still have no way to get disconnection information when workload is blocking. The example would be running your example with no What do you think about it? |
Do you mean that drogon's worker thread is blocked? |
Yes, consider the example be slightly modified:
If we would be able to set up disconnection callback, we could run |
add a new mr |
Is your feature request related to a problem? Please describe.
In our project we are trying to use Drogon for very long requests (up to 10 minutes long). While it is possible to detect client disconnection when using async streaming responses (by checking
stream->send()
return value), it is impossible to detect client disconnection early using standard response. It makes it impossible to stop long running workloads and free server resources upon client disconnection.Describe the solution you'd like
It would be nice to be able to install client disconnection callback. We could use the callback to execute workload stopping mechanism on our end.
Describe alternatives you've considered
There is no alternative I know of.
The text was updated successfully, but these errors were encountered: