Java com.google.common.util.concurrent RateLimiter fields, constructors, methods, implement or subclass

Example usage for Java com.google.common.util.concurrent RateLimiter fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.google.common.util.concurrent RateLimiter.

The text is from its open source code.

Method

doubleacquire()
Acquires a single permit from this RateLimiter , blocking until the request can be granted.
doubleacquire(int permits)
Acquires the given number of permits from this RateLimiter , blocking until the request can be granted.
RateLimitercreate(double permitsPerSecond)
Creates a RateLimiter with the specified stable throughput, given as "permits per second" (commonly referred to as QPS, queries per second).
RateLimitercreate(double permitsPerSecond, long warmupPeriod, TimeUnit unit)
Creates a RateLimiter with the specified stable throughput, given as "permits per second" (commonly referred to as QPS, queries per second), and a warmup period, during which the RateLimiter smoothly ramps up its rate, until it reaches its maximum rate at the end of the period (as long as there are enough requests to saturate it).
doublegetRate()
Returns the stable rate (as permits per seconds ) with which this RateLimiter is configured with.
voidsetRate(double permitsPerSecond)
Updates the stable rate of this RateLimiter , that is, the permitsPerSecond argument provided in the factory method that constructed the RateLimiter .
booleantryAcquire()
Acquires a permit from this RateLimiter if it can be acquired immediately without delay.
booleantryAcquire(int permits)
Acquires permits from this RateLimiter if it can be acquired immediately without delay.
booleantryAcquire(int permits, long timeout, TimeUnit unit)
Acquires the given number of permits from this RateLimiter if it can be obtained without exceeding the specified timeout , or returns false immediately (without waiting) if the permits would not have been granted before the timeout expired.