public interface RequestThrottler extends Closeable
Usage in non-blocking applications: beware that all built-in implementations of this interface
use locks for internal coordination, and do not qualify as lock-free, with the obvious exception
of PassThroughRequestThrottler
. If your application enforces strict lock-freedom, then
request throttling should not be enabled.
Modifier and Type | Method and Description |
---|---|
void |
register(Throttled request)
Registers a new request to be throttled.
|
void |
signalError(Throttled request,
Throwable error)
Signals that a request has failed.
|
void |
signalSuccess(Throttled request)
Signals that a request has succeeded.
|
void |
signalTimeout(Throttled request)
Signals that a request has timed out.
|
void register(@NonNull Throttled request)
Throttled.onThrottleReady(boolean)
when the request is allowed to proceed.void signalSuccess(@NonNull Throttled request)
void signalError(@NonNull Throttled request, @NonNull Throwable error)
void signalTimeout(@NonNull Throttled request)
Note: requests are responsible for handling their own timeout. The throttler does not perform time-based eviction on pending requests.
Copyright © 2017–2024. All rights reserved.