async function cancelquery() {
controller.abort()
}
This works fine on the client side, i.e., the client does no longer wait for the result when I click the Cancel button. However, I don't know how to catch the "abort" signal on the server side to stop the computation. Is there any external variable, method or event in Vapor that I could use to know that the client sent an Abort signal?
Otherwise, if stream is readable, error stream with a TypeError.
If connection uses HTTP/2, then transmit an RST_STREAM frame.
Otherwise, the user agent should close connection unless it would be bad for performance to do so.
For instance, the user agent could keep the connection open if it knows there’s only a few bytes of transfer remaining on a reusable connection. In this case it could be worse to close the connection and go through the handshake process again for the next fetch.
Thus, what Vapor sees is dependent on exactly where in the flow we are, but typically this will manifest as a connection being closed.
In most cases this will be ignored, but if you are streaming a body upload then it will manifest with the body stream terminating with an error.