Package dev.failsafe
Class 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 dev.failsafe.PolicyBuilder
config
-
Constructor Summary
ConstructorsConstructorDescriptionBulkheadBuilder
(int maxConcurrency) BulkheadBuilder
(BulkheadConfig<R> config) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newBulkhead
using the builder's configuration.withMaxWaitTime
(Duration maxWaitTime) Configures themaxWaitTime
to wait for permits to be available.Methods inherited from class dev.failsafe.PolicyBuilder
onFailure, onSuccess
-
Constructor Details
-
BulkheadBuilder
BulkheadBuilder(int maxConcurrency) -
BulkheadBuilder
BulkheadBuilder(BulkheadConfig<R> config)
-
-
Method Details
-
build
Builds a newBulkhead
using the builder's configuration. -
withMaxWaitTime
Configures themaxWaitTime
to wait for permits to be available. If permits cannot be acquired before themaxWaitTime
is exceeded, then the bulkhead will throwBulkheadFullException
.This setting only applies when the resulting Bulkhead is used with the
Failsafe
class. It does not apply when the Bulkhead is used in a standalone way.- Throws:
NullPointerException
- ifmaxWaitTime
is null
-