FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: Add abort() to WriteChannel interface · Issue #9101 · googleapis/google-cloud-java · GitHub

feat: Add abort() to WriteChannel interface #9101

Description

This is a proposal to add a new method abort() to the com.google.cloud.WriteChannel interface (and probably to com.google.cloud.ReadChannel)

Justification:

WriteChannel implies scenarios when sent data are buffered and flushed only when the close() method is called. If something unplanned happens in the middle, this interface doesn't allow it to close the channel without flushing the collected data. Look at the example:

        try (WriteChannel writer = storage.writer(blobInfo)) {
            while (someCondition) {
                ...
                writer.write(data);
                ...
            }
            if (somethingWentWrong) {
                // how to tell close() to not flush the data?
            }
        } // channel will be closed here

abort() would handle this case elegantly.

The request for abort() came from the Storage to support the aborting of resumable upload.
Storage-202,
Storage-1232

Perhaps, other components need this functionality as well.

Please consider including abort() in the WriteChannel interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: storageIssues related to the Cloud Storage API.priority: p4type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL