ContextT - public final class LifoBlockingLimiter<ContextT> extends java.lang.Object implements Limiter<ContextT>
Limiter decorator that blocks the caller when the limit has been reached. This
strategy ensures the resource is properly protected but favors availability over latency
by not fast failing requests when the limit has been reached. To help keep success latencies
low and minimize timeouts any blocked requests are processed in last in/first out order.
Use this limiter only when the threading model allows the limiter to be blocked.| Modifier and Type | Class and Description |
|---|---|
static class |
LifoBlockingLimiter.Builder<ContextT> |
Limiter.Listener| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<Limiter.Listener> |
acquire(ContextT context)
Acquire a token from the limiter.
|
static <ContextT> LifoBlockingLimiter.Builder<ContextT> |
newBuilder(Limiter<ContextT> delegate) |
java.lang.String |
toString() |
public static <ContextT> LifoBlockingLimiter.Builder<ContextT> newBuilder(Limiter<ContextT> delegate)
public java.util.Optional<Limiter.Listener> acquire(ContextT context)
Limiterpublic java.lang.String toString()
toString in class java.lang.Object