google/dart-neats

Retry: Retry If Retruned Object Meets a Condition

Open

#45 aperta il 1 giu 2020

Vedi su GitHub
 (8 commenti) (4 reazioni) (0 assegnatari)Dart (93 fork)auto 404
enhancementgood first issuepkg:retry

Metriche repository

Star
 (508 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Hi,

I'd like to retry if the returned object meets a condition.

Example:

      final response = await retry(
      // Make a GET request
      () => http.get('https://google.com'),
      // Retry on Exception
      retryIf: (e) => e is SocketException,
      retryIfReturnedObject: (o) => o == "retry-please"
  );

is this possible? Thanks

Guida contributor