Closed armed closed 2 months ago
This is pretty difficult question to answer.
It is not safe to look at the server selector as that is not a locked / thread-safe resource to observe from request threads. Disconnects treated as request cancellation is not something Mummy is built to respect or even consider since that is pretty unusual in my opinion.
This is not a scenario I have examples for nor can I easily explain how to accomplish this since I do not know how the request thread blocking on a DB call could get interrupted, etc. Mummy may not be a good option for this way of implementing things.
If you are open to alternative solutions, I suggest looking at the BigQuery HTTP API: https://cloud.google.com/bigquery/docs/reference/rest
You can have a "start query" call, a "cancel" call, and a "poll results" call. This avoids long-lived connection-state-sensitive stuff, and just has simple light-weight API calls.
Hi, nim noob here.
I've a simple server which makes long running request to a DB which supports cancellation.
At the moment server waits until timeout and then prints error
Dropped response to disconnected client
and db connection is terminated.I've been using http server in Clojure, it has builtin abort detection mechanism as a part of request body. I'm testing mummy fork with a proc which basically does this check
request.clientSocket in server.selector
and returns boolean.Maybe there is a better way?