go 1.0.6

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

go

Pub Gitter

Seamlessly launch isolates to perform side jobs.

Parallelize a task

import 'package:go/go.dart';

int twice(int a) => a * 2;

main() async {
  print(await go(twice, 5));
}

Convert a task to remote task

import 'package:go/go.dart';

int twice(int a) => a * 2;

main() async {
  Task twiceTask = remoteTask(twice);
  print(await twiceTask(5));
}

Parallel map of Iterable

import 'package:go/go.dart';

int twice(int a) => a * 2;

main() async {
  print(await goMap(twice, new List.generate(10, (int d) => d + 1)));
}

Same task many times

Executes same task many times with same parameters.

int twice(int a) => a * 2;

main() async {
  print(await goMany(twice, 5, 20));
}

Herd a group

int twice(int a) => a * 2;

main() async {
  final Herd<int, int> many = await herd(twice, 5);
  print(await many.execSame(5));
  print(await many.exec([10, 11, 12, 13, 14]));
  await many.shutdown();
}

Changelog

1.0.5

  • Herd

1.0.4

  • go and stream encode and decode result and response
  • stream handles exceptions on remote isolate gracefully

1.0.3

  • go handles exceptions on remote isolates correctly

1.0.2

  • goMany
  • goMap

1.0.1

  • stream
  • remoteStream

1.0.0

  • go executes the given function in another isolate and returns results
  • remoteTask returns converts a task into a remote executed task

example/go_example.dart

import 'package:go/go.dart';

int twice(int a) => a * 2;

main() async {
  print(await go(twice, 5));

  // [remoteTask] example
  Task twiceTask = remoteTask(twice);
  print(await twiceTask(5));
}

Use this package as a library

1. Depend on it

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


dependencies:
  go: "^1.0.6"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


      import 'package:go/go.dart';
  
Version Uploaded Documentation Archive
1.0.6 Jan 3, 2018 Go to the documentation of go 1.0.6 Download go 1.0.6 archive
1.0.5 Dec 31, 2017 Go to the documentation of go 1.0.5 Download go 1.0.5 archive
1.0.4 Dec 31, 2017 Go to the documentation of go 1.0.4 Download go 1.0.4 archive
1.0.3 Dec 31, 2017 Go to the documentation of go 1.0.3 Download go 1.0.3 archive
1.0.2 Dec 30, 2017 Go to the documentation of go 1.0.2 Download go 1.0.2 archive
1.0.1 Dec 30, 2017 Go to the documentation of go 1.0.1 Download go 1.0.1 archive
1.0.0 Dec 30, 2017 Go to the documentation of go 1.0.0 Download go 1.0.0 archive

Analysis

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

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
54 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
77
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

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

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
async ^1.13.3 1.13.3 2.0.7
Transitive dependencies
collection 1.14.10
Dev dependencies
test ^0.12.0