isolate 2.0.2

  • Readme
  • Changelog
  • Installing
  • 80

Build Status

Helps with isolates and isolate communication in Dart.

The package contains individual libraries with different purposes.

Creating send ports and responding to messages. #

The "ports.dart" sub-library contains functionality for creating SendPorts and reacting to values sent to those ports.

Working with isolates and running functions in other isolates. #

The "isolate_runner.dart" sub-library introduces an IsolateRunner class that gives easy access to the Isolate functionality, and also gives a way to run new functions in the isolate repeatedly, instead of just on the initial spawn call.

A central registry for values that can be used across isolates. #

The "registry.dart" sub-library provides a way to create an object registry, and give access to it across different isolates.

Balancing load across several isolates. #

The "load_balancer.dart" sub-library can manage multiple Runner objects, including IsolateRunner, and run functions on the currently least loaded runner.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

2.0.3 #

  • Update SDK requirements.

2.0.1 #

  • Use lower-case constants from dart:io.

2.0.0 #

  • Make port functions generic so they can be used in a Dart 2 type-safe way.

1.1.0 #

  • Add generic arguments to run in LoadBalancer and IsolateRunner.
  • Add generic arguments to singleCallbackPort and singleCompletePort.

1.0.0 #

  • Change to using package:test for testing.

0.2.3 #

  • Fixed strong mode analysis errors.
  • Migrated tests to package:test.

0.2.2 #

  • Made Isolate.kill parameter priority a named parameter.

0.2.1 #

  • Fixed spelling in a number of doc comments and the README.

0.2.0 #

  • Renamed library isolaterunner.dart to isolate_runner.dart.
  • Renamed library loadbalancer.dart' toload_balancer.dart`.

0.1.0 #

  • Initial version
  • Adds IsolateRunner as a helper around Isolate.
  • Adds single-message port helpers and a load balancer.

Use this package as a library

1. Depend on it

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


dependencies:
  isolate: ^2.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter 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/isolate.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
95
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
48
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

We analyzed this package on Jan 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.4

Health suggestions

Fix lib/registry.dart. (-12.66 points)

Analysis of lib/registry.dart reported 27 hints, including:

line 51 col 34: Unnecessary new keyword.

line 70 col 24: Use = to separate a named parameter from its default value.

line 77 col 13: Unnecessary new keyword.

line 88 col 13: Unnecessary new keyword.

line 109 col 14: Unnecessary new keyword.

Fix lib/ports.dart. (-10.89 points)

Analysis of lib/ports.dart reported 23 hints, including:

line 51 col 33: Unnecessary new keyword.

line 61 col 13: Unnecessary new keyword.

line 104 col 33: Unnecessary new keyword.

line 129 col 13: Unnecessary new keyword.

line 132 col 28: Unnecessary new keyword.

Fix lib/src/errors.dart. (-7.71 points)

Analysis of lib/src/errors.dart reported 16 hints, including:

line 60 col 31: Unnecessary new keyword.

line 69 col 9: Unnecessary new keyword.

line 77 col 30: Unnecessary new keyword.

line 87 col 28: Unnecessary new keyword.

line 87 col 45: Unnecessary new keyword.

Fix additional 5 files with analysis or formatting issues. (-18.10 points)

Additional issues in the following files:

  • lib/isolate_runner.dart (14 hints)
  • lib/load_balancer.dart (11 hints)
  • lib/src/raw_receive_port_multiplexer.dart (5 hints)
  • lib/src/util.dart (5 hints)
  • lib/runner.dart (2 hints)

Maintenance suggestions

Package is getting outdated. (-52.33 points)

The package was last published 79 weeks ago.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and isolate.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.55.0 <3.0.0
Dev dependencies
test ^0.12.0