Package ratpack.exec.util.retry
Interface DurationRetryPolicyBuilder
-
public interface DurationRetryPolicyBuilderBuilds aDurationRetryPolicy.- Since:
- 1.7
- See Also:
DurationRetryPolicy.of(ratpack.func.Action)
-
-
Field Summary
Fields Modifier and Type Field Description static java.time.ClockDEFAULT_CLOCKThere should be no reasons for changing this on production code.static DelayDEFAULT_DELAYBy default, retries will wait 1 second between executions.static java.time.DurationDEFAULT_MAX_DURATIONBy default, this retry policy will give up after 30 seconds since the first error occurrence.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DurationRetryPolicybuild()Builds aDurationRetryPolicy.DurationRetryPolicyBuilderclock(java.time.Clock clock)Clock used to determine current time.DurationRetryPolicyBuilderdelay(Delay delay)The delay strategy.DurationRetryPolicyBuildermaxDuration(java.time.Duration maxDuration)Maximum duration until timeout of the retry policy.
-
-
-
Field Detail
-
DEFAULT_DELAY
static final Delay DEFAULT_DELAY
By default, retries will wait 1 second between executions.
-
DEFAULT_MAX_DURATION
static final java.time.Duration DEFAULT_MAX_DURATION
By default, this retry policy will give up after 30 seconds since the first error occurrence.
-
DEFAULT_CLOCK
static final java.time.Clock DEFAULT_CLOCK
There should be no reasons for changing this on production code.
-
-
Method Detail
-
build
DurationRetryPolicy build()
Builds aDurationRetryPolicy.- Returns:
- a retry policy
-
delay
DurationRetryPolicyBuilder delay(Delay delay)
The delay strategy.- Parameters:
delay- the delay strategy- Returns:
- this
-
maxDuration
DurationRetryPolicyBuilder maxDuration(java.time.Duration maxDuration)
Maximum duration until timeout of the retry policy.- Parameters:
maxDuration- the maximum duration- Returns:
- this
-
clock
DurationRetryPolicyBuilder clock(java.time.Clock clock)
Clock used to determine current time.- Parameters:
clock- clock used to determine current time- Returns:
- this
-
-