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
Add onSendProgress callback #579
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
Hope this gets merged, it would really help |
@tlueder @jasonroland @piotrsed any updates on this? |
Hi, I can rebase this. But without a clear path forward I don't see the point. Currently I just use this plugin from my repro via dependency override, works great. |
}, | ||
), | ||
); | ||
response = await ioRequest.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to needs close this ioRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been a while since I've last had a look at this.
But I need the response from the ioRequest for the code that follows and I guess that was the easiest way I could think of.
But if that is not a good idea or best practice I'm all in for improvements.
Please fix merge conflicts! |
@kevmoo done |
This looks like a breaking change, and we have been avoiding breaking API changes. This is only breaking for a subset of users, but I don't know what proportion. We are currently getting through a major version bump without too much difficulty, but that was a version bump without breaking API changes. cc @brianquinlan for thoughts on the practicality of a breaking API change and another version bump. |
This is a API change for sure but I would argue against a breaking one. This adds a new optional feature. And should not break anything for anyone not using it. Can you elaborate what you mean by "This is only breaking for a subset of users"? |
This is breaking for classes with overrides of the changed methods. |
Of course, I haven't even thought about that. |
interface class ProgressTracker {
void onSendProgress(int loaded, int total);
}
class ProgressTrackingRequest extends StreamedRequest implements ProgressTracker {
...
} And if (request is ProgressTracker) {
request.onSendProcess(...);
} That's a bit ugly.
|
|
This fixes the upload part of #465
I had also tried to include the download progress, but that did not work as expected.
And it is why easier to do this while consuming the response stream.