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.

1.05k
likes
25
points
1.65M
downloads

Publisher

verified publishergoogle.dev

Weekly Downloads

Execute a function repeatedly until no exception is thrown

Homepage

License

Unlicense (license)

More

Packages that depend on retry