-
Notifications
You must be signed in to change notification settings - Fork 362
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
Cancellable requests #204
Comments
does |
So, is this the proposed way to cancel a given request ? this force us to create a new client per request to allow fine-grained control to which request to cancel. |
+1 |
I don't think that As for me this is a major language design problem but Dart team is fighting as hard as they can to not implement cancellation... There are multiple bugs with request for this and all of them are closed as |
I'm wondering what are rationales not to implement cancellation? First impression on |
IMHO they don't do it because of the javascript. These futures are 100% copy of promises from JS and they also can't be canceled. It might be that they are using promises under the hood when compiling for web. As for me, I was told all my life to use resources sparingly and always close/release what I don't need. This situation with non-cancelable futures just drives me crazy... |
Closing as a duplicate of #424 which has more direct discussion of the API.
Primarily because designing the API and rolling it out is very difficult in a widely used package like this. It is something we want to work on though.
Cancellation is a potentially complex concept. Not all Changing returns types from
Dart We don't use |
I'm using Dart Http in a Flutter app to download large files from a server.
Sometimes the user may want to cancel the request (so that the download is stopped)
The problem is that there is no way to cancel a
Future
in dart. Even when converted to aStream
which can be cancelled, the download will still continue running in the background.The text was updated successfully, but these errors were encountered: