Skip to content

Provides logging for Dart 'Completer' when the future doesn't complete in a reasonable amount of time.

License

Notifications You must be signed in to change notification settings

onepub-dev/completer_ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CompleterEx provides a wrapper for a Dart Completer.

Dart Completer's can be hard to diagnose when they don't complete.

There is no active stack visible in the debugger and essentially no trace that the completer is hanging.

CompleterEx helps to detect these problems by logging out any running Completers after a defined time period (10 seconds).

You can directly replace all existing Completer's with CompleterEx.


var old = Completer<int>();

becomes

var better = CompleterEx<int>();

You can change the logging interval globally by calling:

CompleterEx.reportInterval(Duration(seconds: 30));

Logging

CompleterEx uses the simple_logger to log possible problems.

When it logs a CompleterEx it also logs the Stacktrace showing where the CompleterEx was allocated from.

About

Provides logging for Dart 'Completer' when the future doesn't complete in a reasonable amount of time.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages