Class GuavaRateLimiter

  • All Implemented Interfaces:
    RateLimiter

    @Internal
    public class GuavaRateLimiter
    extends Object
    implements RateLimiter
    An implementation of RateLimiter based on Guava's RateLimiter.
    • Constructor Detail

      • GuavaRateLimiter

        public GuavaRateLimiter​(double maxPerSecond)
    • Method Detail

      • acquire

        public CompletionStage<Void> acquire()
        Description copied from interface: RateLimiter
        Returns a future that is completed once another event would not exceed the rate limit. For correct functioning, the next invocation of this method should only happen after the previously returned future has been completed.
        Specified by:
        acquire in interface RateLimiter