public interface ThrottlingStrategy
Modifier and Type | Method and Description |
---|---|
void |
stop()
Stop and free any resources needed by the strategy.
|
org.forgerock.util.promise.Promise<Long,org.forgerock.util.promise.NeverThrowsException> |
throttle(String partitionKey,
ThrottlingRate throttlingRate)
Based on the given partitionKey and throttlingRate, return if the call is accepted or not.
|
org.forgerock.util.promise.Promise<Long,org.forgerock.util.promise.NeverThrowsException> throttle(String partitionKey, ThrottlingRate throttlingRate)
This method returns a promise as the decision to let this call going through can be queued and thus completed later. That may allow for example to queue the first calls and complete the returned promises at a constant rate.
partitionKey
- the key used to identify the different groupsthrottlingRate
- the throttling rate to applyPromise
meaning that the call is accepted (succeeds with 0) or refused (succeeds with value
greater than 0)void stop()
Copyright © 2025 Open Identity Platform Community. All rights reserved.