go 1.0.6

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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
28
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]
14
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://dart.dev/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

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

Admin