Skip to content

storage: a way to abort a request #600

Description

@gmiroshnykov

It seems there is no way to abort an upload or download request created by file.createWriteStream() and file.createReadStream() respectively.

Node's native HTTP client has request.abort(), but as far as I can tell the above methods return simple through2 streams and keep the raw HTTP requests / responses hidden.

So is there a way to abort a request in progress?

Activity

  1. added
    type: questionRequest for information or clarification. Not an issue.
    api: storageIssues related to the Cloud Storage API.
    on May 15, 2015
  2. added this to the Storage Future milestone on May 15, 2015
  3. ryanseys commented on May 17, 2015

    @ryanseys
    Contributor

    You should be able to destroy the stream with stream.destroy() and assuming that validation is turned on (on by default), the upload/download will fail. Can you try that and let us know how that works?

  4. gmiroshnykov commented on May 17, 2015

    @gmiroshnykov
    Author

    stream.destroy() seems to work great, thanks!

  5. ryanseys commented on May 17, 2015

    @ryanseys
    Contributor

    Perfect! Glad we could help! 😄

  6. 6 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions