future_ext 1.1.0 copy "future_ext: ^1.1.0" to clipboard
future_ext: ^1.1.0 copied to clipboard

A tool to control `Future`.

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();

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.

1
likes
130
points
42
downloads

Publisher

unverified uploader

Weekly Downloads

A tool to control `Future`.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

More

Packages that depend on future_ext