Class RetryPolicies.Builder

    • Method Detail

      • delay

        public RetryPolicies.Builder delay​(Duration delay)
        Sets an initial delay between invocations, that is repeatedly multiplied by delayFactor.

        The default value is 200ms.

        Parameters:
        delay - an overall timeout
        Returns:
        a modified builder instance
      • delayFactor

        public RetryPolicies.Builder delayFactor​(double delayFactor)
        Sets a factor that prolongs the delay for an every new execute.

        The default value is 2.

        Parameters:
        delayFactor - a delay prolonging factor
        Returns:
        a modified builder instance
      • callTimeout

        public RetryPolicies.Builder callTimeout​(Duration callTimeout)
        Sets a limit for each invocation.

        The default value is 500ms.

        Parameters:
        callTimeout - an invocation timeout - a limit per call
        Returns:
        a modified builder instance
      • overallTimeout

        public RetryPolicies.Builder overallTimeout​(Duration overallTimeout)
        Sets a overall limit for all invocation, including delays.

        The default value is 2s.

        Parameters:
        overallTimeout - an overall timeout
        Returns:
        a modified builder instance
      • executor

        public RetryPolicies.Builder executor​(ScheduledExecutorService executorService)
        Sets a custom executor used to invoke a method call.

        By default single-threaded executor is used.

        Parameters:
        executorService - the custom scheduled executor service
        Returns:
        a modified builder instance