async_track 0.2.0

  • Installing
  • Versions
  • 0

async_track #

Build Status Pub

Provides a mechanism for tracking asynchronous events in Dart.

This package is experimental and subject to change. It currently only has knowledge of microtasks and timers, and ignores other forms of asynchronous events DOM access, network events, file I/O.

Usage #

You can use track asynchronous events once or continuously.

runTracked #

Future/*<E>*/ runTracked/*<E>*/(/*=E*/ action()) runs action within a Zone, and returns a Future when all asynchronous events started by action (or started by other events) complete.

For example, waiting for some tasks to complete:

await runTracked(() {
  // Any of these could use 'scheduleMicrotask' to schedule work.

AsyncTracker #

For continuous tracking, you can use AsyncTracker, which reports progress of asynchronous events continuously. See async_track.dart.

How it works #

Uses the Dart Zone API to create an execution context where a function call and all of it's associated calls and asynchronous tasks are associated with that zone.

Changelog #

0.2.0 #

  • Added AsyncError object
  • Added onError callback to runTracked
  • Added onError stream to AsyncTracker
  • Added useLongStackTraces as a parameter to new AsyncTracker

0.1.0 #

  • Initial commit

Use this package as a library

1. Depend on it

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

  async_track: ^0.2.0

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:async_track/async_track.dart';
Version Uploaded Documentation Archive
0.2.0 Nov 16, 2016 Go to the documentation of async_track 0.2.0 Download async_track 0.2.0 archive
0.1.0 Sep 30, 2016 Go to the documentation of async_track 0.1.0 Download async_track 0.1.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
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

Maintenance issues and suggestions

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

Dependencies were not resolved.