-
Notifications
You must be signed in to change notification settings - Fork 50
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
Clarify CancelableOperation
docs
#264
Comments
Cancelling a |
What is the protocol?
|
The issue here is: CancelableOperation.fromFuture(forever()) where a cancelable operations is created without an You can't cancel a future. Futures do not represent operations, they represent (eventual) results of operations. That's simply what they are designed for, and it's why they can be safely shared. You can cancel a computation if it allows so, by accepting input that can trigger the cancel, and acting on it. You can reasonably wrap a non-cancelable operation in So, the protocol is that whatever you pass a Nothing can stop |
If true, that's something specific to Dart (other language have async routines raise an exception when cancelled). I'd say the intended use is not clear for the docs.
What protocol? Its not in the docs (also the OP's complaint). I think you're saying Could also make onCancel required if this is the case. |
Clarify that
CancelableOperation
doesn't actually cancel the operationdart-lang/sdk#42855
https://pub.dev/documentation/async/latest/async/CancelableOperation-class.html
The text was updated successfully, but these errors were encountered: