Class BulkheadBuilder<R>
java.lang.Object
dev.failsafe.PolicyBuilder<BulkheadBuilder<R>, BulkheadConfig<R>, R>
dev.failsafe.BulkheadBuilder<R>
- Type Parameters:
R- result type
- All Implemented Interfaces:
PolicyListeners<BulkheadBuilder<R>, R>
Builds
Bulkhead instances.
This class is not threadsafe.
- See Also:
-
Field Summary
Fields inherited from class PolicyBuilder
config -
Constructor Summary
ConstructorsConstructorDescriptionBulkheadBuilder(int maxConcurrency) BulkheadBuilder(BulkheadConfig<R> config) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newBulkheadusing the builder's configuration.withMaxWaitTime(Duration maxWaitTime) Configures themaxWaitTimeto wait for permits to be available.Methods inherited from class PolicyBuilder
onFailure, onSuccess
-
Constructor Details
-
BulkheadBuilder
BulkheadBuilder(int maxConcurrency) -
BulkheadBuilder
BulkheadBuilder(BulkheadConfig<R> config)
-
-
Method Details
-
build
-
withMaxWaitTime
Configures themaxWaitTimeto wait for permits to be available. If permits cannot be acquired before themaxWaitTimeis exceeded, then the bulkhead will throwBulkheadFullException.This setting only applies when the resulting Bulkhead is used with the
Failsafeclass. It does not apply when the Bulkhead is used in a standalone way.- Throws:
NullPointerException- ifmaxWaitTimeis null
-