Interface FaultTolerance.Builder.BulkheadBuilder<T,​R>

  • Enclosing interface:
    FaultTolerance.Builder<T,​R>

    public static interface FaultTolerance.Builder.BulkheadBuilder<T,​R>
    Configures a bulkhead.
    See Also:
    @Bulkhead
    • Method Detail

      • limit

        FaultTolerance.Builder.BulkheadBuilder<T,​R> limit​(int value)
        Sets the concurrency limit the bulkhead will enforce. Defaults to 10.
        Parameters:
        value - the concurrency limit, must be >= 1
        Returns:
        this bulkhead builder
      • queueSize

        FaultTolerance.Builder.BulkheadBuilder<T,​R> queueSize​(int value)
        Sets the maximum size of the bulkhead queue. Defaults to 10.

        May only be called if the builder configures fault tolerance for asynchronous actions. In other words, if the builder was not created using createAsync, this method throws an exception.

        Parameters:
        value - the queue size, must be >= 1
        Returns:
        this bulkhead builder
      • onAccepted

        FaultTolerance.Builder.BulkheadBuilder<T,​R> onAccepted​(Runnable callback)
        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

        FaultTolerance.Builder.BulkheadBuilder<T,​R> onRejected​(Runnable callback)
        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

        FaultTolerance.Builder.BulkheadBuilder<T,​R> onFinished​(Runnable callback)
        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

        FaultTolerance.Builder<T,​R> done()
        Returns the original fault tolerance builder.
        Returns:
        the original fault tolerance builder