Package ratpack.exec.util.retry
Interface DurationRetryPolicyBuilder
-
public interface DurationRetryPolicyBuilder
Builds aDurationRetryPolicy
.- Since:
- 1.7
- See Also:
DurationRetryPolicy.of(Action)
-
-
Field Summary
Fields Modifier and Type Field Description static Clock
DEFAULT_CLOCK
There should be no reasons for changing this on production code.static Delay
DEFAULT_DELAY
By default, retries will wait 1 second between executions.static Duration
DEFAULT_MAX_DURATION
By 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 DurationRetryPolicy
build()
Builds aDurationRetryPolicy
.DurationRetryPolicyBuilder
clock(Clock clock)
Clock used to determine current time.DurationRetryPolicyBuilder
delay(Delay delay)
The delay strategy.DurationRetryPolicyBuilder
maxDuration(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 Duration DEFAULT_MAX_DURATION
By default, this retry policy will give up after 30 seconds since the first error occurrence.
-
DEFAULT_CLOCK
static final 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(Duration maxDuration)
Maximum duration until timeout of the retry policy.- Parameters:
maxDuration
- the maximum duration- Returns:
- this
-
clock
DurationRetryPolicyBuilder clock(Clock clock)
Clock used to determine current time.- Parameters:
clock
- clock used to determine current time- Returns:
- this
-
-