go 1.0.6

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

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

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: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
Popularity:
Describes how popular the package is relative to other packages. [more]
38
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
19
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0