use of cn.taketoday.retry.policy.TimeoutRetryPolicy in project today-framework by TAKETODAY.
the class RetryTemplateBuilder method withinMillis.
/**
* Allows retry if there is no more than {@code timeout} millis since first attempt.
* <p>
* Invocation of this method does not discard default exception classification rule,
* that is "retry only on {@link Exception} and it's subclasses".
*
* @param timeout whole execution timeout in milliseconds
* @return this
* @see TimeoutRetryPolicy
*/
public RetryTemplateBuilder withinMillis(long timeout) {
Assert.isTrue(timeout > 0, "Timeout should be positive");
Assert.isNull(this.baseRetryPolicy, "You have already selected another retry policy");
TimeoutRetryPolicy timeoutRetryPolicy = new TimeoutRetryPolicy();
timeoutRetryPolicy.setTimeout(timeout);
this.baseRetryPolicy = timeoutRetryPolicy;
return this;
}
use of cn.taketoday.retry.policy.TimeoutRetryPolicy in project today-infrastructure by TAKETODAY.
the class RetryTemplateBuilder method withinMillis.
/**
* Allows retry if there is no more than {@code timeout} millis since first attempt.
* <p>
* Invocation of this method does not discard default exception classification rule,
* that is "retry only on {@link Exception} and it's subclasses".
*
* @param timeout whole execution timeout in milliseconds
* @return this
* @see TimeoutRetryPolicy
*/
public RetryTemplateBuilder withinMillis(long timeout) {
Assert.isTrue(timeout > 0, "Timeout should be positive");
Assert.isNull(this.baseRetryPolicy, "You have already selected another retry policy");
TimeoutRetryPolicy timeoutRetryPolicy = new TimeoutRetryPolicy();
timeoutRetryPolicy.setTimeout(timeout);
this.baseRetryPolicy = timeoutRetryPolicy;
return this;
}
Aggregations