cancelable_compute 1.1.1
cancelable_compute: ^1.1.1 copied to clipboard

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!);
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

License #

MIT

1
likes
130
pub points
34%
popularity

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

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on cancelable_compute