future_ext

Last updated:

0 purchases

future_ext Image
future_ext Images
Add to Cart

Description:

future ext

ControllableFuture #

Cancel the Future

final controllable = ControllableFuture(() async {
/// some asynchronous code here,
}, onCancel: () {
// return an alternate value
});

// to wait
await controllable.future;

// to cancel
controllable.cancel();
copied to clipboard
Why not CancelableOperaion in package:async ? #
It does not step out of the Future on cancellation. It just ignores the Future.
But this package actually cancels it.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.