public interface RetryPolicy
| Modifier and Type | Field and Description |
|---|---|
static long |
NO_RETRY |
| Modifier and Type | Method and Description |
|---|---|
default boolean |
hedge()
返回true则不cancel任何一次重试,重试过程中任何一次返回成功都拿来做最终结果
返回false则开始下一次重试时,之前超时的请求就算后来结果成功返回也没有用
|
static RetryPolicy |
noRetry() |
long |
retry(int retryCount) |
static RetryPolicy |
retryNTimes(int times) |
static RetryPolicy |
retryNTimes(int times,
long delayInMs) |
static RetryPolicy |
retryNTimes(int times,
long delayInMs,
boolean hedge) |
default boolean |
triggerGetOnTimeout() |
static final long NO_RETRY
static RetryPolicy noRetry()
static RetryPolicy retryNTimes(int times)
static RetryPolicy retryNTimes(int times, @Nonnegative long delayInMs)
static RetryPolicy retryNTimes(int times, @Nonnegative long delayInMs, boolean hedge)
long retry(int retryCount)
retryCount - 当前重试的次数(1为第一次重试)NO_RETRYdefault boolean hedge()
default boolean triggerGetOnTimeout()
Copyright © 2019. All rights reserved.