Package akka.util

Class NanoTimeTokenBucket

  • public final class NanoTimeTokenBucket
    extends TokenBucket
    Default implementation of TokenBucket that uses System.nanoTime as the time source.
    • Constructor Summary

      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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NanoTimeTokenBucket

        public NanoTimeTokenBucket​(long _cap,
                                   long _period)
    • 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 class TokenBucket
        return the current time in nanos as a Long.