-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Cancel streamed downloads & fix progress for downloads #2032
Conversation
Before review: Could we abstract the implementation of this cancellation above the specific adapter? If we're doing this in adapters, then every adapter needs to consider the same functionality. |
I will see what I can do, but I already know that this is basically not supported on web. |
Sure, but we have thousands of adapters around the world. :) |
This is hard without breaking. If we want to do this in the |
This is a lot more complex. We have completely different behavior for different adapters when doing streamed responses/downloads and most of it can not be abstracted away. For For |
b2de49f
to
33ddefe
Compare
What about the HTTP/2 adapter? |
Fixed it there as well. I think we should merge this and brain storm if we can abstract this away separately. |
Marvelous! |
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.
/// Cancel any up/download streams and connections | ||
/// if the [CancelToken] is cancelled | ||
/// and propagate the [DioException] to the response stream. | ||
cancelFuture?.whenComplete(() { |
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.
We have asynchronous gaps between this call and other awaits. Can we do this earlier or separated?
@kuhnroyal Is this still on your track? The last time I review this it only remains a few nits. |
Yea |
Superseeded by #2068 due to lots of updates on main |
New Pull Request Checklist
main
branch to avoid conflicts (via merge from master or rebase)CHANGELOG.md
in the corresponding packageAdditional context and info (if any)