Retry Task
constructor(@NonNull task: Task, @NonNull retryTask: Task, shouldRetry: BooleanSupplier, maxRetries: Int)
Creates a new RetryTask.
Parameters
task
Supplies the task to run on the first attempt.
retry Task
The task to run on retries if the retry condition fails.
should Retry
A condition that returns true if a retry should be attempted, or false if the task should finish without retrying.
max Retries
The maximum number of retries allowed.
Creates a new RetryTask where the retry task is the same as the initial one.
Parameters
task
A supplier that creates a new instance of the task to run.
should Retry
A condition that returns true if a retry should be attempted, or false if the task should finish without retrying.
max Retries
The maximum number of retries allowed.