Package com.shri.restinpeace
Class BulkheadConfig.Builder
java.lang.Object
com.shri.restinpeace.BulkheadConfig.Builder
- Enclosing class:
- BulkheadConfig
Builds a
BulkheadConfig.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the config.maxConcurrentCalls(int maxConcurrentCalls) Sets the concurrency cap.maxWaitDuration(Duration maxWaitDuration) Sets how long a call waits for a free permit before being refused with aBulkheadFullException- a queueing tolerance for a bursty caller (see the high-fan-out async persona in the design doc) rather than the fail-fast default, where every permit already being held immediately refuses the call.
-
Method Details
-
maxConcurrentCalls
Sets the concurrency cap.- Parameters:
maxConcurrentCalls- the maximum number of calls to this client permitted in flight at once; must be at least 1- Returns:
- this builder
-
maxWaitDuration
Sets how long a call waits for a free permit before being refused with aBulkheadFullException- a queueing tolerance for a bursty caller (see the high-fan-out async persona in the design doc) rather than the fail-fast default, where every permit already being held immediately refuses the call.- Parameters:
maxWaitDuration- the maximum wait for a permit;Duration.ZERO(the default) fails immediately instead of waiting at all; must not be negative- Returns:
- this builder
-
build
Builds the config.- Returns:
- the built config
-