- java.lang.Object
-
- io.helidon.faulttolerance.Bulkhead.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bulkhead
build()
Build the instance from this builder.Bulkhead.Builder
cancelSource(boolean cancelSource)
Policy to cancel any source stage if the value return byFtHandler.invoke(java.util.function.Supplier<? extends java.util.concurrent.CompletionStage<T>>)
is cancelled.Bulkhead.Builder
config(Config config)
Load all properties for this bulkhead from configuration.Bulkhead.Builder
executor(Supplier<? extends ExecutorService> executor)
Configure executor service to use for executing tasks asynchronously.Bulkhead.Builder
limit(int limit)
Maximal number of parallel requests going through this bulkhead.Bulkhead.Builder
name(String name)
A name assigned for debugging, error reporting or configuration purposes.Bulkhead.Builder
queueLength(int queueLength)
Maximal number of enqueued requests waiting for processing.
-
-
-
Method Detail
-
build
public Bulkhead build()
Description copied from interface:Builder
Build the instance from this builder.
-
executor
public Bulkhead.Builder executor(Supplier<? extends ExecutorService> executor)
Configure executor service to use for executing tasks asynchronously.- Parameters:
executor
- executor service supplier- Returns:
- updated builder instance
-
limit
public Bulkhead.Builder limit(int limit)
Maximal number of parallel requests going through this bulkhead. When the limit is reached, additional requests are enqueued.- Parameters:
limit
- maximal number of parallel calls, defaults is 10- Returns:
- updated builder instance
-
queueLength
public Bulkhead.Builder queueLength(int queueLength)
Maximal number of enqueued requests waiting for processing. When the limit is reached, additional attempts to invoke a request will receive aBulkheadException
.- Parameters:
queueLength
- length of queue- Returns:
- updated builder instance
-
name
public Bulkhead.Builder name(String name)
A name assigned for debugging, error reporting or configuration purposes.- Parameters:
name
- the name- Returns:
- updated builder instance
-
cancelSource
public Bulkhead.Builder cancelSource(boolean cancelSource)
Policy to cancel any source stage if the value return byFtHandler.invoke(java.util.function.Supplier<? extends java.util.concurrent.CompletionStage<T>>)
is cancelled. Default istrue
; mostly used by FT MP to change default.- Parameters:
cancelSource
- cancel source policy- Returns:
- updated builder instance
-
config
public Bulkhead.Builder config(Config config)
Load all properties for this bulkhead from configuration.
Configuration key default value description name Bulkhead-N Name used for debugging limit 10 Max number of parallel calls queue-length 10 Max number of queued calls cancel-source true Cancel task source if task is cancelled - Parameters:
config
- the config node to use- Returns:
- updated builder instance
-
-