cancelable_compute 1.2.0 copy "cancelable_compute: ^1.2.0" to clipboard
cancelable_compute: ^1.2.0 copied to clipboard

outdated

Spawn an isolate, run callback on that isolate, passing it message, and return the value returned by callback or canceled by user.

pub package

cancelable-compute.dart #

Allows you to cancel compute operation.

Usage #

A simple usage example:

import 'package:cancelable_compute/cancelable_compute.dart';

Future<void> main() async {
  var operation = compute(fib, 256);

  void onTap() {
    operation.cancel(-1);
  }

  final result = await operation.value;
  print(result!);
}

Note for Web #

Cancel don't stop running future.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

License #

MIT

4
likes
0
pub points
73%
popularity

Publisher

unverified uploader

Spawn an isolate, run callback on that isolate, passing it message, and return the value returned by callback or canceled by user.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on cancelable_compute