From 021ed738be6e9827427c8e9ba7b423c550517f0a Mon Sep 17 00:00:00 2001 From: Yuki Matsumura <define1394@gmail.com> Date: Thu, 8 Mar 2018 21:35:55 +0900 Subject: [PATCH] UPDATE README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index f5eed92..a12c14c 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ The following code delays the retry process with the Binary Exponential Backoff retrofit.webapi() .retryWhen(RxBackoff.exponential(2.0 /* Multiplier */ , 5 /* maxRetryCount */)) .subscribe(...) + + +// retry -> (wait 1~5000ms) -> retry -> (wait 1~5000ms) -> retry ... +retrofit.webapi() + .retryWhen(RxBackoff.random(1 /* low */, 5000 /* high */, 5 /* maxRetryCount */)) + .subscribe(...) ``` The backoff algorithm allows you to choose the built-in one or choose your own one.