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
Fixed by #23425 — how to use req.signal to check that the response was delivered to the client? #23678
Comments
I get the feeling that req.onabort does not contribute at all to this task. |
You can use the signal like so:
It'll be triggered when the response has been fully delivered to the http layer. |
It also works with a stream like so:
|
mmastrac, |
Oh, you have a great example on your blog on Deno 1.43: Deno.serve((req, info) => {
info.completed.then(() => {
console.log("Response sent successfuly!");
}).catch(() => {
console.error("Failed sending the response.");
});
return new Response("Hello world");
}); I think this is what I was looking for, right? |
Correct on both counts. The completed signal will also work. |
How can you make sure that the response is guaranteed to be delivered to the client?
Previously I suggested something like this:
Now I guess it works somehow through req.onabort?
Explain how this should work, because I didn't find it in the API.
The text was updated successfully, but these errors were encountered: