Class RetryableTask

java.lang.Object
org.seppiko.commons.utils.concurrent.RetryableTask

public class RetryableTask extends Object
Retry task
Author:
Leonard Woo
  • Method Details

    • caller

      public static <T> T caller(RetryCallable<T> callable, int times, long delay, TimeUnit unit)
      Retry task caller

      If <T> is Boolean than true, or CharSequence than not null or empty, or Object than not null break retry loop.

      caller will ignore runtime exception.

      Type Parameters:
      T - task return type
      Parameters:
      callable - task retry callable
      times - retry times
      delay - retry delay
      unit - delay time util
      Returns:
      task callable result, failure is null