Skip to content

How to cancel a long-running request? #321

@harvister

Description

@harvister

if I set context.request.body equal to a Deno.Reader in order to stream a long-running response, how do I just cancel it half way through?

I'm looking for something like context.cancel()

I'm running into a problem where a fetch call from a browser client will not fail until either the full request body is read, or the server is stopped. I want to be able to tell the client to fail the request without having to read the remaining request body, which I'm also reading as a Deno.Reader. If the request body is a 1 GB file, I do not want to have to read all of it just so the client will fail the fetch request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions