retry 1.0.0 copy "retry: ^1.0.0" to clipboard
retry: ^1.0.0 copied to clipboard

outdatedDart 1 only

Execute a function repeatedly until no exception is thrown

dart-retry #

Execute a function repeatedly until no exception is thrown

Usage #

import "package:retry/retry.dart";
import "dart:async";

Future connectFunction(){ ... }

Future main() async {
  // Tries to connect to a database 6 times, waiting 10 seconds each time
  final db = await retry(connectFunction);
}

Useful for waiting for a server to come up.

789
likes
15
pub points
99%
popularity

Publisher

verified publishergoogle.dev

Execute a function repeatedly until no exception is thrown

Repository (GitHub)
View/report issues

License

Unlicense (LICENSE)

More

Packages that depend on retry