Package dev.failsafe

Interface Timeout<R>

    • Method Detail

      • builder

        static <R> TimeoutBuilder<R> builder​(java.time.Duration timeout)
        Returns a TimeoutBuilder that builds Timeout instances with the given timeout.
        Parameters:
        timeout - the duration after which an execution is failed with TimeoutExceededException.
        Throws:
        java.lang.NullPointerException - If timeout is null
        java.lang.IllegalArgumentException - If timeout is <= 0
      • builder

        static <R> TimeoutBuilder<R> builder​(TimeoutConfig<R> config)
        Creates a new TimeoutBuilder that will be based on the config.
      • of

        static <R> Timeout<R> of​(java.time.Duration timeout)
        Returns a Timeout that fails an execution with TimeoutExceededException if it exceeds the timeout. Alias for Timeout.builder(timeout).build(). To configure additional options on a Timeout, use builder(Duration) instead.
        Type Parameters:
        R - result type
        Parameters:
        timeout - the duration after which an execution is failed with TimeoutExceededException.
        Throws:
        java.lang.NullPointerException - If timeout is null
        java.lang.IllegalArgumentException - If timeout is <= 0
        See Also:
        builder(Duration)