isolate_executor 2.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 77

isolate_executor

This library contains types that allow for executing code in a spawned isolate, perhaps with additional imports.

Subclass Executable and override its execute method. Invoke IsolateExecutor.executeWithType, passing in that subclass. The code in execute will run in another isolate. Any value it returns will be returned by IsolateExecutor.executeWithType.

A returned value must be a primitive type (anything that is encodable as JSON). You may pass parameters to the other isolate by providing a message map.

Example:

class Echo extends Executable {
  Echo(Map<String, dynamic> message)
      : echoMessage = message['echo'],
        super(message);

  final String echoMessage;

  @override
  Future<dynamic> execute() async {
    return echoMessage;
  }
}

Future main() async {
    final result = await IsolateExecutor.executeWithType(Echo, message: {'echo': 'hello'});
    assert(result == 'hello');
}

Changelog

2.0.1

  • Improve stack trace readability

2.0.0

  • Update for Dart 2

1.0.1

  • Fixes issue when used on Windows OS

1.0.0

  • Initial release

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  isolate_executor: ^2.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:isolate_executor/isolate_executor.dart';
  
Version Uploaded Documentation Archive
2.0.1 Aug 8, 2018 Go to the documentation of isolate_executor 2.0.1 Download isolate_executor 2.0.1 archive
2.0.0 Aug 6, 2018 Go to the documentation of isolate_executor 2.0.0 Download isolate_executor 2.0.0 archive
1.0.1 May 16, 2018 Go to the documentation of isolate_executor 1.0.1 Download isolate_executor 1.0.1 archive
1.0.0 Apr 13, 2018 Go to the documentation of isolate_executor 1.0.0 Download isolate_executor 1.0.0 archive
2.0.0-dev.2 Jul 4, 2018 Go to the documentation of isolate_executor 2.0.0-dev.2 Download isolate_executor 2.0.0-dev.2 archive
2.0.0-dev.1 Jul 4, 2018 Go to the documentation of isolate_executor 2.0.0-dev.1 Download isolate_executor 2.0.0-dev.1 archive
2.0.0-dev May 17, 2018 Go to the documentation of isolate_executor 2.0.0-dev Download isolate_executor 2.0.0-dev archive
Popularity:
Describes how popular the package is relative to other packages. [more]
59
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: other

Primary library: package:isolate_executor/isolate_executor.dart with components: io, isolate, mirrors.

Health suggestions

Format lib/src/executable.dart.

Run dartfmt to format lib/src/executable.dart.

Format lib/src/executor.dart.

Run dartfmt to format lib/src/executor.dart.

Format lib/src/source_generator.dart.

Run dartfmt to format lib/src/source_generator.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use isolate_executor.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
analyzer >=0.32.0 <0.33.0 0.32.6 0.33.0
Transitive dependencies
args 1.5.0
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
csslib 0.14.6
front_end 0.1.4+2 0.1.6
glob 1.1.7
html 0.13.3+3
kernel 0.3.4+2 0.3.6
logging 0.11.3+2
meta 1.1.6
package_config 1.0.5
path 1.6.2
plugin 0.2.0+3
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
test ^1.3.0
test_package