public interface GlobalRateLimiter
Provides resources that can be acquired through the use of withLimiter(Publisher), and held until the
supplied stage completes or terminates with an error. If the limiter resources are exhausted, it will limit all
other attempts, waiting until a resource becomes available.
This rate limiter can have their delay directly modified through rateLimitFor(Duration), determining the
duration a resource holder must wait before processing starts.
| Modifier and Type | Method and Description |
|---|---|
Duration |
getRemaining()
Returns the
Duration remaining until the current global rate limit is completed. |
void |
rateLimitFor(Duration duration)
Sets a new rate limit that will be applied to every operation performed using
withLimiter(Publisher). |
<T> Flux<T> |
withLimiter(Publisher<T> stage)
Provides a scope to perform reactive operations under this global rate limiter.
|
void rateLimitFor(Duration duration)
withLimiter(Publisher).duration - the Duration every new operation should wait before being usedDuration getRemaining()
Duration remaining until the current global rate limit is completed. Can be negative or
zero if there is no currently active global rate limit.Duration indicating the remaining time a global rate limit is being applied. Zero
or negative if no global rate limit is currently active.