executorservices 1.0.1 copy "executorservices: ^1.0.1" to clipboard
executorservices: ^1.0.1 copied to clipboard

outdated

A Dart package providing services that allow you to execute dart code in different executors, ex - isolates.

A library for Dart and Flutter developers.

license.

Description #

It allows you to execute code in isolates or any executor currently supported.

Support concurrent execution of tasks or functions.

Support cleanup of unused isolates.

Support caching of isolate that allow you to reuse them (like thread).

It's extendable.

Usage #

A simple usage example:

import "package:executorservices/executorservices.dart";
import "dart:math";

main() {
  final cachedExecutorService = ExecutorService.newCachedExecutor();

  cachedExecutorService.submitAction(randomInt);

  cachedExecutorService.submit(SomeIntensiveTask());
}

int randomInt() {
  return Random.secure().nextInt(1000);
}

class SomeIntensiveTask extends Task<String> {
  @override
  Future<String> execute() async {
    await Future.delayed(Duration(minutes: 5));
    return "Done executing intensive task";
  }
} 

Features and bugs #

Please file feature requests and bugs at the issue tracker.

5
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A Dart package providing services that allow you to execute dart code in different executors, ex - isolates.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

meta

More

Packages that depend on executorservices