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 |
|---|---|
static GlobalRateLimiter |
create()
Create a default limiter based off
BucketGlobalRateLimiter that can be shared across multiple
RestClient for coordinated global rate limit actions. |
Mono<Duration> |
getRemaining()
Returns the
Duration remaining until the current global rate limit is completed. |
Mono<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.
|
static GlobalRateLimiter create()
BucketGlobalRateLimiter that can be shared across multiple
RestClient for coordinated global rate limit actions.GlobalRateLimiterMono<Void> rateLimitFor(Duration duration)
withLimiter(Publisher).duration - the Duration every new operation should wait before being usedMono<Duration> 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.