computer 1.0.2

  • Readme
  • Changelog
  • Installing
  • 76

Computer #

Computer is a lightweight library for concurrent computations, which provides Flutter's compute() like API.

Features #

  • Easy to use API
  • No overhead for creating & releasing isolates for each task. Workers initialized on start and ready to solve your tasks
  • Strictly defined count of workers

How to use #

Computer is a singleton, that provides just 3 methods

turnOn() #

await Computer().turnOn(
  workersCount: 4, // optional, default 2
  areLogsEnabled: false, // optional, default false
);

Before using the Computer you need to turnOn it. This will create workers and initialize them. Then you may use compute() method.

compute() #

var answer = await Computer().compute(
  fib,
  param: 45, // optional
);

compute will execute your function inside one of the workers. Function may be async

turnOff() #

await Computer().turnOff();

If you don't need workers anymore, you should turnOff the Computer. It will destroy workers.

1.0.0 #

Published package

1.0.1 #

Added README, fixed pub package troubles

1.0.2 #

Fixed typos & turnOn()

Use this package as a library

1. Depend on it

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


dependencies:
  computer: ^1.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:computer/computer.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
52
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Nov 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:computer/computer.dart with components: isolate.

Maintenance suggestions

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 computer.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.49.0 <3.0.0
meta ^1.1.7 1.1.8