Interface LimitAlgorithm.Token
- Enclosing interface:
LimitAlgorithm
public static interface LimitAlgorithm.Token
When a token is retrieved from
LimitAlgorithm.tryAcquire()
, one of its methods must be called when the task
is over, to release the token back to the pool (such as a permit returned to a Semaphore
).
Choice of method to invoke may influence the algorithm used for determining number of available permits.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dropped()
Operation was dropped, for example because it hit a timeout, or was rejected by other limits.void
ignore()
The operation failed before any meaningful RTT measurement could be made and should be ignored to not introduce an artificially low RTT.void
success()
Notification that the operation succeeded and internally measured latency should be used as an RTT sample.
-
Method Details
-
dropped
void dropped()Operation was dropped, for example because it hit a timeout, or was rejected by other limits. Loss basedLimit
implementations will likely do an aggressive reducing in limit when this happens. -
ignore
void ignore()The operation failed before any meaningful RTT measurement could be made and should be ignored to not introduce an artificially low RTT. -
success
void success()Notification that the operation succeeded and internally measured latency should be used as an RTT sample.
-