Interface FtHandler

  • All Known Subinterfaces:
    Bulkhead, CircuitBreaker, Retry, Timeout

    public interface FtHandler
    A fault tolerance handler. The following handlers do NOT implement this interface:
    • Async - used to create reactive objects from blocking synchronous calls through an executor service
    • Fallback - implements FtHandlerTyped instead.
    • Method Detail

      • name

        String name()
        A name assigned to a handler for debugging, error reporting or configuration purposes.
        Returns:
        a non-null name for this handler
      • invoke

        <T> Single<T> invoke​(Supplier<? extends CompletionStage<T>> supplier)
        Invoke this fault tolerance handler on a supplier of a CompletionStage, such as a Single.
        Type Parameters:
        T - type of future result
        Parameters:
        supplier - that provides the initial value for processing; depending on handler type, the supplier may be called multiple times
        Returns:
        a new single that can be consumed that will carry out the fault tolerance in the background, may have a different error states than the original result obtained from supplier
      • invokeMulti

        <T> Multi<T> invokeMulti​(Supplier<? extends Flow.Publisher<T>> supplier)
        Invoke this fault tolerance handler on a supplier of a Flow.Publisher, such as a Multi.
        Type Parameters:
        T - type of future result
        Parameters:
        supplier - that provides the initial value for processing; depending on handler type, the supplier may be called multiple times
        Returns:
        a new multi that can be consumed that will carry out the fault tolerance in the background, may have a different error states than the original result obtained from supplier