Package akka.util
Class NanoTimeTokenBucket
- java.lang.Object
-
- akka.util.TokenBucket
-
- akka.util.NanoTimeTokenBucket
-
public final class NanoTimeTokenBucket extends TokenBucket
Default implementation ofTokenBucket
that usesSystem.nanoTime
as the time source.
-
-
Constructor Summary
Constructors Constructor Description NanoTimeTokenBucket(long _cap, long _period)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
currentTime()
The current time in nanos.-
Methods inherited from class akka.util.TokenBucket
init, offer
-
-
-
-
Method Detail
-
currentTime
public long currentTime()
Description copied from class:TokenBucket
The current time in nanos. The returned value is monotonic, might wrap over and has no relationship with wall-clock.- Specified by:
currentTime
in classTokenBucket
- Returns:
- return the current time in nanos as a Long.
-
-