public interface ThreadPoolBulkhead
extends java.lang.AutoCloseable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ThreadPoolBulkhead.Metrics |
static interface |
ThreadPoolBulkhead.ThreadPoolBulkheadEventPublisher
An EventPublisher which can be used to register event consumers.
|
| Modifier and Type | Method and Description |
|---|---|
default <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> |
decorateCallable(java.util.concurrent.Callable<T> callable)
Returns a supplier which submits a value-returning task for execution and
returns a CompletionStage representing the asynchronous computation of the task.
|
static <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> |
decorateCallable(ThreadPoolBulkhead bulkhead,
java.util.concurrent.Callable<T> callable)
Returns a supplier which submits a value-returning task for execution and
returns a
CompletionStage representing the pending results of the task. |
default java.util.function.Supplier<java.util.concurrent.CompletionStage<java.lang.Void>> |
decorateRunnable(java.lang.Runnable runnable)
Returns a supplier which submits a task for execution and returns a
CompletionStage representing the
asynchronous computation of the task. |
static java.util.function.Supplier<java.util.concurrent.CompletionStage<java.lang.Void>> |
decorateRunnable(ThreadPoolBulkhead bulkhead,
java.lang.Runnable runnable)
Returns a supplier which submits a task for execution and returns a
CompletionStage representing the state of the task. |
default <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> |
decorateSupplier(java.util.function.Supplier<T> supplier)
Returns a supplier which submits a value-returning task for execution and
returns a CompletionStage representing the asynchronous computation of the task.
|
static <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> |
decorateSupplier(ThreadPoolBulkhead bulkhead,
java.util.function.Supplier<T> supplier)
Returns a supplier which submits a value-returning task for execution
and returns a
CompletionStage representing the pending results of the task. |
default <T> java.util.concurrent.CompletionStage<T> |
executeCallable(java.util.concurrent.Callable<T> callable)
Submits a value-returning task for execution and returns a
CompletionStage representing the
asynchronous computation of the task. |
default java.util.concurrent.CompletionStage<java.lang.Void> |
executeRunnable(java.lang.Runnable runnable)
Submits a task for execution and returns a
CompletionStage representing the
asynchronous computation of the task. |
default <T> java.util.concurrent.CompletionStage<T> |
executeSupplier(java.util.function.Supplier<T> supplier)
Submits a value-returning task for execution and returns a
CompletionStage representing the
asynchronous computation of the task. |
ThreadPoolBulkheadConfig |
getBulkheadConfig()
Returns the ThreadPoolBulkheadConfig of this Bulkhead.
|
ThreadPoolBulkhead.ThreadPoolBulkheadEventPublisher |
getEventPublisher()
Returns an EventPublisher which subscribes to the reactive stream of BulkheadEvent and can be
used to register event consumers.
|
ThreadPoolBulkhead.Metrics |
getMetrics()
Get the Metrics of this Bulkhead.
|
java.lang.String |
getName()
Returns the name of this bulkhead.
|
io.vavr.collection.Map<java.lang.String,java.lang.String> |
getTags()
Returns an unmodifiable map with tags assigned to this Retry.
|
static ThreadPoolBulkhead |
of(java.lang.String name,
java.util.function.Supplier<ThreadPoolBulkheadConfig> bulkheadConfigSupplier)
Creates a bulkhead with a custom configuration
|
static ThreadPoolBulkhead |
of(java.lang.String name,
ThreadPoolBulkheadConfig config)
Creates a bulkhead with a custom configuration
|
static ThreadPoolBulkhead |
of(java.lang.String name,
ThreadPoolBulkheadConfig config,
io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Creates a bulkhead with a custom configuration
|
static ThreadPoolBulkhead |
ofDefaults(java.lang.String name)
Create a Bulkhead with a default configuration.
|
<T> java.util.concurrent.CompletionStage<T> |
submit(java.util.concurrent.Callable<T> task)
Submits a value-returning task for execution and returns a
CompletionStage representing the
asynchronous computation of the task. |
java.util.concurrent.CompletionStage<java.lang.Void> |
submit(java.lang.Runnable task)
Submits a task for execution to the ThreadPoolBulkhead and returns a
CompletionStage representing the
asynchronous computation of the task. |
static <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> decorateCallable(ThreadPoolBulkhead bulkhead, java.util.concurrent.Callable<T> callable)
CompletionStage representing the pending results of the task.
The Supplier throws a BulkheadFullException if the task cannot be submitted, because the Bulkhead is full.T - the result type of the callablebulkhead - the bulkheadcallable - the value-returning task to submitstatic <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> decorateSupplier(ThreadPoolBulkhead bulkhead, java.util.function.Supplier<T> supplier)
CompletionStage representing the pending results of the task.
The Supplier throws a BulkheadFullException if the task cannot be submitted, because the Bulkhead is full.T - the result type of the supplierbulkhead - the bulkheadsupplier - the value-returning task to submitstatic java.util.function.Supplier<java.util.concurrent.CompletionStage<java.lang.Void>> decorateRunnable(ThreadPoolBulkhead bulkhead, java.lang.Runnable runnable)
CompletionStage representing the state of the task.
The Supplier throws a BulkheadFullException if the task cannot be submitted, because the Bulkhead is full.bulkhead - the bulkheadrunnable - the to submitstatic ThreadPoolBulkhead ofDefaults(java.lang.String name)
name - the name of the bulkheadstatic ThreadPoolBulkhead of(java.lang.String name, ThreadPoolBulkheadConfig config)
name - the name of the bulkheadconfig - a custom BulkheadConfig configurationstatic ThreadPoolBulkhead of(java.lang.String name, ThreadPoolBulkheadConfig config, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
name - the name of the bulkheadconfig - a custom BulkheadConfig configurationstatic ThreadPoolBulkhead of(java.lang.String name, java.util.function.Supplier<ThreadPoolBulkheadConfig> bulkheadConfigSupplier)
name - the name of the bulkheadbulkheadConfigSupplier - custom configuration supplier<T> java.util.concurrent.CompletionStage<T> submit(java.util.concurrent.Callable<T> task)
CompletionStage representing the
asynchronous computation of the task.T - the type of the task's resulttask - the value-returning task to submitBulkheadFullException
when the task could not be submitted, because the Bulkhead was fullBulkheadFullException - if the task cannot be submitted, because the Bulkhead is fulljava.util.concurrent.CompletionStage<java.lang.Void> submit(java.lang.Runnable task)
CompletionStage representing the
asynchronous computation of the task.task - the task to submitBulkheadFullException - if the task cannot be submitted, because the Bulkhead is fulljava.lang.String getName()
ThreadPoolBulkheadConfig getBulkheadConfig()
ThreadPoolBulkhead.Metrics getMetrics()
io.vavr.collection.Map<java.lang.String,java.lang.String> getTags()
ThreadPoolBulkhead.ThreadPoolBulkheadEventPublisher getEventPublisher()
default <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> decorateSupplier(java.util.function.Supplier<T> supplier)
BulkheadFullException if the task cannot be submitted, because the Bulkhead is full.T - the result type of the callablesupplier - the value-returning task to submitdefault <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> decorateCallable(java.util.concurrent.Callable<T> callable)
BulkheadFullException if the task cannot be submitted, because the Bulkhead is full.T - the result type of the callablecallable - the value-returning task to submitdefault java.util.function.Supplier<java.util.concurrent.CompletionStage<java.lang.Void>> decorateRunnable(java.lang.Runnable runnable)
CompletionStage representing the
asynchronous computation of the task.
The Supplier throws a BulkheadFullException if the task cannot be submitted, because the Bulkhead is full.runnable - the task to submitdefault <T> java.util.concurrent.CompletionStage<T> executeSupplier(java.util.function.Supplier<T> supplier)
CompletionStage representing the
asynchronous computation of the task.T - the type of the task's resultsupplier - the value-returning task to submitBulkheadFullException - if the task cannot be submitted, because the Bulkhead is fulldefault <T> java.util.concurrent.CompletionStage<T> executeCallable(java.util.concurrent.Callable<T> callable)
CompletionStage representing the
asynchronous computation of the task.T - the result type of the Callablecallable - the value-returning task to submitCompletionStage representing the asynchronous computation of the task.BulkheadFullException - if the task cannot be submitted, because the Bulkhead is fulldefault java.util.concurrent.CompletionStage<java.lang.Void> executeRunnable(java.lang.Runnable runnable)
CompletionStage representing the
asynchronous computation of the task.runnable - the task to submitBulkheadFullException - if the task cannot be submitted, because the Bulkhead is full