Skip to content
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

feat: Add abort() to WriteChannel interface #9101

Closed
dmitry-fa opened this issue Jun 26, 2020 · 3 comments
Closed

feat: Add abort() to WriteChannel interface #9101

dmitry-fa opened this issue Jun 26, 2020 · 3 comments
Labels
api: storage Issues related to the Cloud Storage API. priority: p4 type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@dmitry-fa
Copy link

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.

@frankyn
Copy link
Member

frankyn commented Jun 26, 2020

@chingor13 what do you think about introducing abort into WriteChannel? It might be too specific, but wanted to get your thoughts on it.

@frankyn frankyn added api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jun 26, 2020
@chingor13 chingor13 assigned Neenu1995 and unassigned chingor13 Sep 8, 2021
@Neenu1995 Neenu1995 assigned meltsufin and unassigned Neenu1995 Jul 26, 2022
@meltsufin meltsufin removed their assignment Jul 26, 2022
@suztomo suztomo transferred this issue from googleapis/java-core Feb 8, 2023
@BenWhitehead
Copy link
Contributor

Closing in favor of tracking via googleapis/java-storage#202

@suztomo
Copy link
Member

suztomo commented Feb 8, 2023

Thank you for context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. priority: p4 type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

7 participants