Interface RequestThrottler

  • All Superinterfaces:
    AutoCloseable, Closeable

    public interface RequestThrottler
    extends Closeable
    Limits the number of concurrent requests executed by the driver.

    Usage in non-blocking applications: beware that some implementations of this interface use locks for internal coordination, and do not qualify as lock-free. If your application enforces strict lock-freedom, then you should use the PassThroughRequestThrottler or the ConcurrencyLimitingRequestThrottler.

    • Method Detail

      • signalSuccess

        void signalSuccess​(@NonNull
                           Throttled request)
        Signals that a request has succeeded. This indicates to the throttler that another request might be started.
      • signalError

        void signalError​(@NonNull
                         Throttled request,
                         @NonNull
                         Throwable error)
        Signals that a request has failed. This indicates to the throttler that another request might be started.
      • signalTimeout

        void signalTimeout​(@NonNull
                           Throttled request)
        Signals that a request has timed out. This indicates to the throttler that this request has stopped (if it was running already), or that it doesn't need to be started in the future.

        Note: requests are responsible for handling their own timeout. The throttler does not perform time-based eviction on pending requests.

      • signalCancel

        default void signalCancel​(@NonNull
                                  Throttled request)
        Signals that a request has been cancelled. This indicates to the throttler that another request might be started.