Package dev.failsafe

Interface RetryPolicy<R>

Type Parameters:
R - result type
All Superinterfaces:
Policy<R>
All Known Implementing Classes:
RetryPolicyImpl

public interface RetryPolicy<R> extends Policy<R>
A policy that defines when retries should be performed. See RetryPolicyBuilder for configuration options.

This class is threadsafe.

See Also:
  • Method Details

    • builder

      static <R> RetryPolicyBuilder<R> builder()
      Creates a RetryPolicyBuilder that by default will build a RetryPolicy that allows 3 execution attempts max with no delay, unless configured otherwise.
      See Also:
    • builder

      static <R> RetryPolicyBuilder<R> builder(RetryPolicyConfig<R> config)
      Creates a new RetryPolicyBuilder that will be based on the config.
    • ofDefaults

      static <R> RetryPolicy<R> ofDefaults()
      Creates a RetryPolicy that allows 3 execution attempts max with no delay. To configure additional options on a RetryPolicy, use builder() instead.
      See Also:
    • getConfig

      RetryPolicyConfig<R> getConfig()
      Returns the RetryPolicyConfig that the RetryPolicy was built with.
      Specified by:
      getConfig in interface Policy<R>