-
public interface BlockingStrategySpecifies the way to block current thread to amount of time required to refill missed number of tokens in the bucket. There is default implementationPARKING, also you can provide any other implementation which for example does something useful instead of blocking(acts as co-routine) or does spin loop.
-
-
Field Summary
Fields Modifier and Type Field Description static BlockingStrategyPARKING
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidpark(long nanosToPark)Park current thread to required duration of nanoseconds.
-
-
-
Field Detail
-
PARKING
static final BlockingStrategy PARKING
-
-
Method Detail
-
park
void park(long nanosToPark) throws InterruptedException
Park current thread to required duration of nanoseconds. ThrowsInterruptedExceptionin case of current thread was interrupted.- Parameters:
nanosToPark- time to park in nanoseconds- Throws:
InterruptedException- if current thread is interrupted.
-
-