google/dart-neats

Retry: Retry If Retruned Object Meets a Condition

Open

#45 建立於 2020年6月1日

在 GitHub 查看
 (8 留言) (4 反應) (0 負責人)Dart (93 fork)auto 404
enhancementgood first issuepkg:retry

倉庫指標

Star
 (508 star)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南