Interface TypedGuard.Builder.TimeoutBuilder<T>

Enclosing interface:
TypedGuard.Builder<T>

public static interface TypedGuard.Builder.TimeoutBuilder<T>
Configures a timeout.
See Also:
  • @Timeout
  • Method Details

    • duration

      TypedGuard.Builder.TimeoutBuilder<T> duration(long value, ChronoUnit unit)
      Sets the timeout duration. Defaults to 1 second.
      Parameters:
      value - the timeout length, must be >= 0
      unit - the timeout unit, must not be null
      Returns:
      this timeout builder
      See Also:
      • @Timeout.value
      • @Timeout.unit
    • onTimeout

      Sets a callback that will be invoked when an invocation times out.

      The callback must be fast and non-blocking and must not throw an exception.

      Parameters:
      callback - the timeout callback, must not be null
      Returns:
      this timeout builder
    • onFinished

      Sets a callback that will be invoked when an invocation finishes before the timeout.

      The callback must be fast and non-blocking and must not throw an exception.

      Parameters:
      callback - the finished callback, must not be null
      Returns:
      this timeout builder
    • done

      Returns the original fault tolerance builder.
      Returns:
      the original fault tolerance builder
    • with