Package io.smallrye.faulttolerance.api
Interface Guard.Builder.TimeoutBuilder
- Enclosing interface:
Guard.Builder
public static interface Guard.Builder.TimeoutBuilder
Configures a timeout.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondone()Returns the original fault tolerance builder.duration(long value, ChronoUnit unit) Sets the timeout duration.onFinished(Runnable callback) Sets a callback that will be invoked when an invocation finishes before the timeout.Sets a callback that will be invoked when an invocation times out.default Guard.Builder.TimeoutBuilderwith(Consumer<Guard.Builder.TimeoutBuilder> consumer)
-
Method Details
-
duration
Sets the timeout duration. Defaults to 1 second.- Parameters:
value- the timeout length, must be >= 0unit- the timeout unit, must not benull- Returns:
- this timeout builder
- See Also:
-
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 benull- 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 benull- Returns:
- this timeout builder
-
done
Guard.Builder done()Returns the original fault tolerance builder.- Returns:
- the original fault tolerance builder
-
with
-