- java.lang.Object
-
- io.helidon.faulttolerance.Timeout.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Timeout
build()
Build the instance from this builder.Timeout.Builder
cancelSource(boolean cancelSource)
Cancel source if destination stage is cancelled.Timeout.Builder
config(Config config)
Load all properties for this circuit breaker from configuration.Timeout.Builder
currentThread(boolean currentThread)
Flag to indicate that code must be executed in current thread instead of in an executor's thread.Timeout.Builder
executor(ScheduledExecutorService executor)
Executor service to schedule the timeout.Timeout.Builder
name(String name)
A name assigned for debugging, error reporting or configuration purposes.Timeout.Builder
timeout(Duration timeout)
Timeout duration.
-
-
-
Method Detail
-
build
public Timeout build()
Description copied from interface:Builder
Build the instance from this builder.
-
timeout
public Timeout.Builder timeout(Duration timeout)
Timeout duration.- Parameters:
timeout
- duration of the timeout of operations handled by the new Timeout instance- Returns:
- updated builder instance
-
currentThread
public Timeout.Builder currentThread(boolean currentThread)
Flag to indicate that code must be executed in current thread instead of in an executor's thread. This flag isfalse
by default.- Parameters:
currentThread
- setting for this timeout- Returns:
- updated builder instance
-
executor
public Timeout.Builder executor(ScheduledExecutorService executor)
Executor service to schedule the timeout.- Parameters:
executor
- scheduled executor service to use- Returns:
- updated builder instance
-
name
public Timeout.Builder name(String name)
A name assigned for debugging, error reporting or configuration purposes.- Parameters:
name
- the name- Returns:
- updated builder instance
-
cancelSource
public Timeout.Builder cancelSource(boolean cancelSource)
Cancel source if destination stage is cancelled.- Parameters:
cancelSource
- setting for cancel source, defaults (@code true}- Returns:
- updated builder instance
-
config
public Timeout.Builder config(Config config)
Load all properties for this circuit breaker from configuration.
Configuration key default value description timeout 10 seconds Length of timeout current-thread false Control that task is executed in calling thread name Timeout-N Name used for debugging cancel-source true Cancel task source if task is cancelled - Parameters:
config
- the config node to use- Returns:
- updated builder instance
-
-