Class SemaphoreThreadPoolBulkhead<V>
java.lang.Object
io.smallrye.faulttolerance.core.bulkhead.BulkheadBase<V>
io.smallrye.faulttolerance.core.bulkhead.SemaphoreThreadPoolBulkhead<V>
- All Implemented Interfaces:
FaultToleranceStrategy<V>
- Direct Known Subclasses:
FutureThreadPoolBulkhead
Assumes that this bulkhead is already executed on an extra thread.
Under that assumption, we don't have to submit tasks to another executor
or use an actual queue. We just limit the task execution by semaphores.
-
Field Summary
Fields inherited from class io.smallrye.faulttolerance.core.bulkhead.BulkheadBase
description -
Constructor Summary
ConstructorsConstructorDescriptionSemaphoreThreadPoolBulkhead(FaultToleranceStrategy<V> delegate, String description, int size, int queueSize) -
Method Summary
Modifier and TypeMethodDescriptionapply(InvocationContext<V> ctx) Apply the fault tolerance strategy around the targetCallable.
-
Constructor Details
-
SemaphoreThreadPoolBulkhead
public SemaphoreThreadPoolBulkhead(FaultToleranceStrategy<V> delegate, String description, int size, int queueSize)
-
-
Method Details
-
apply
Description copied from interface:FaultToleranceStrategyApply the fault tolerance strategy around the targetCallable. TheCallableis wrapped in anInvocationContext.- Parameters:
ctx- theInvocationContextwrapping theCallableguarded by this fault tolerance strategy- Returns:
- result computed by the target
Callable - Throws:
Exception- if result couldn't be computed
-