public final class RetriableTask<T> extends Object
Modifier and Type | Method and Description |
---|---|
static <U> Task<U> |
withRetryPolicy(String name,
RetryPolicy policy,
Function1<Integer,Task<U>> taskFunction)
A helper for creating task wrapper with associated retry policy.
|
public static <U> Task<U> withRetryPolicy(String name, RetryPolicy policy, Function1<Integer,Task<U>> taskFunction)
U
- Type of a task result.name
- A name of the task that needs to be retried.policy
- Retry policy that will control this task's behavior.taskFunction
- A task generator function. It will receive a zero-based attempt number as a parameter.Copyright © 2018. All rights reserved.