Package dev.failsafe

Class BulkheadBuilder<R>

Type Parameters:
R - result type
All Implemented Interfaces:
PolicyListeners<BulkheadBuilder<R>,R>

public class BulkheadBuilder<R> extends PolicyBuilder<BulkheadBuilder<R>,BulkheadConfig<R>,R>
Builds Bulkhead instances.

This class is not threadsafe.

See Also:
  • Constructor Details

    • BulkheadBuilder

      BulkheadBuilder(int maxConcurrency)
    • BulkheadBuilder

      BulkheadBuilder(BulkheadConfig<R> config)
  • Method Details

    • build

      public Bulkhead<R> build()
      Builds a new Bulkhead using the builder's configuration.
    • withMaxWaitTime

      public BulkheadBuilder<R> withMaxWaitTime(Duration maxWaitTime)
      Configures the maxWaitTime to wait for permits to be available. If permits cannot be acquired before the maxWaitTime is exceeded, then the bulkhead will throw BulkheadFullException.

      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 - if maxWaitTime is null