Interface TypedGuard.Builder.BulkheadBuilder<T>

Enclosing interface:
TypedGuard.Builder<T>

public static interface TypedGuard.Builder.BulkheadBuilder<T>
Configures a bulkhead.
See Also:
  • @Bulkhead
  • Method Details

    • limit

      Sets the concurrency limit the bulkhead will enforce. Defaults to 10.
      Parameters:
      value - the concurrency limit, must be >= 1
      Returns:
      this bulkhead builder
      See Also:
      • @Bulkhead.value
    • queueSize

      TypedGuard.Builder.BulkheadBuilder<T> queueSize(int value)
      Sets the maximum size of the bulkhead queue. Defaults to 10.
      Parameters:
      value - the queue size, must be >= 1
      Returns:
      this bulkhead builder
      See Also:
      • @Bulkhead.waitingTaskQueue
    • enableSynchronousQueueing

      TypedGuard.Builder.BulkheadBuilder<T> enableSynchronousQueueing()
      Enables bulkhead queueing for synchronous actions.

      If you use this method, you have to ensure that the guard is executed on a virtual thread.

      Returns:
      this bulkhead builder
    • onAccepted

      Sets a callback that will be invoked when this bulkhead accepts an invocation. In case of asynchronous actions, accepting into bulkhead doesn't mean the action is immediately invoked; the invocation is first put into a queue and may wait there.

      The callback must be fast and non-blocking and must not throw an exception.

      Parameters:
      callback - the accepted callback, must not be null
      Returns:
      this bulkhead builder
    • onRejected

      Sets a callback that will be invoked when this bulkhead rejects an invocation.

      The callback must be fast and non-blocking and must not throw an exception.

      Parameters:
      callback - the rejected callback, must not be null
      Returns:
      this bulkhead builder
    • onFinished

      Sets a callback that will be invoked when a finished invocation leaves this bulkhead.

      The callback must be fast and non-blocking and must not throw an exception.

      Parameters:
      callback - the finished callback, must not be null
      Returns:
      this bulkhead builder
    • done

      Returns the original fault tolerance builder.
      Returns:
      the original fault tolerance builder
    • with