Interface Fallback<T>

Type Parameters:
T - type of the values returned
All Superinterfaces:
FtHandlerTyped<T>

public interface Fallback<T> extends FtHandlerTyped<T>
Fallback allows the user to execute an alternative function in case the provided supplier fails.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <T> Fallback<T>
    create(io.helidon.faulttolerance.FallbackConfig<T> fallbackConfig)
    Create a fallback based on configuration.
    static <T> Fallback<T>
    create(Consumer<io.helidon.faulttolerance.FallbackConfig.Builder<T>> configConsumer)
    Create a fallback and customize its configuration.
    static <T> Fallback<T>
    createFromMethod(Function<Throwable,? extends T> method)
    Create a fallback from the fallback method.

    Methods inherited from interface io.helidon.faulttolerance.FtHandlerTyped

    invoke
  • Method Details

    • create

      static <T> Fallback<T> create(io.helidon.faulttolerance.FallbackConfig<T> fallbackConfig)
      Create a fallback based on configuration.
      Type Parameters:
      T - type of the values returned by the failing method
      Parameters:
      fallbackConfig - fallback configuration
      Returns:
      a new fallback
    • create

      static <T> Fallback<T> create(Consumer<io.helidon.faulttolerance.FallbackConfig.Builder<T>> configConsumer)
      Create a fallback and customize its configuration.
      Type Parameters:
      T - type of the values returned by the failing method
      Parameters:
      configConsumer - consumer of configuration
      Returns:
      a new fallback
    • createFromMethod

      static <T> Fallback<T> createFromMethod(Function<Throwable,? extends T> method)
      Create a fallback from the fallback method.
      Type Parameters:
      T - fallback method return type
      Parameters:
      method - method to use
      Returns:
      a new fallback