- Type Parameters:
T- type of the values returned
- All Superinterfaces:
FtHandlerTyped<T>
Fallback allows the user to execute an alternative function in case the provided supplier fails.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T> Fallback<T> create(FallbackConfig<T> fallbackConfig) Create a fallback based on configuration.static <T> Fallback<T> create(Consumer<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
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
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
Create a fallback from the fallback method.- Type Parameters:
T- fallback method return type- Parameters:
method- method to use- Returns:
- a new fallback
-