public static final class ResilienceConfiguration.TimeLimiterConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_SHOULD_CANCEL_RUNNING_FUTURE
The default behaviour for canceling running tasks.
|
static Duration |
DEFAULT_TIMEOUT_DURATION
The default timeout duration.
|
Modifier and Type | Method and Description |
---|---|
static ResilienceConfiguration.TimeLimiterConfiguration |
disabled()
Creates a new
TimeLimiterConfiguration that allows for requests to run indefinitely, effectively
disabling timeouts. |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isEnabled()
Get the status indicator for TimeLimiter.
|
static ResilienceConfiguration.TimeLimiterConfiguration |
of() |
static ResilienceConfiguration.TimeLimiterConfiguration |
of(Duration timeoutDuration)
Create a timeout by specifying a timeout duration.
|
boolean |
shouldCancelRunningFuture()
Whether to cancel the running future.
|
ResilienceConfiguration.TimeLimiterConfiguration |
shouldCancelRunningFuture(boolean shouldCancelRunningFuture)
Whether to cancel the running future.
|
@NonNull Duration |
timeoutDuration()
The timeout duration.
|
ResilienceConfiguration.TimeLimiterConfiguration |
timeoutDuration(@NonNull Duration timeoutDuration)
The timeout duration.
|
public static final Duration DEFAULT_TIMEOUT_DURATION
public static final boolean DEFAULT_SHOULD_CANCEL_RUNNING_FUTURE
public boolean isEnabled()
@Nonnull public static ResilienceConfiguration.TimeLimiterConfiguration disabled()
TimeLimiterConfiguration
that allows for requests to run indefinitely, effectively
disabling timeouts.@Nonnull public static ResilienceConfiguration.TimeLimiterConfiguration of(@Nonnull Duration timeoutDuration)
TimeLimiterConfiguration.of().timeoutDuration( int )
instead.timeoutDuration
- The maximum duration to wait for a request to return.TimeLimiterConfiguration
.public static ResilienceConfiguration.TimeLimiterConfiguration of()
@NonNull public @NonNull Duration timeoutDuration()
public boolean shouldCancelRunningFuture()
public ResilienceConfiguration.TimeLimiterConfiguration timeoutDuration(@NonNull @NonNull Duration timeoutDuration)
public ResilienceConfiguration.TimeLimiterConfiguration shouldCancelRunningFuture(boolean shouldCancelRunningFuture)
Copyright © 2019 SAP SE. All rights reserved.