Class Limiter

    • Field Detail

    • Constructor Detail

      • Limiter

        public Limiter()
    • Method Detail

      • check

        public abstract boolean check​(long incr)
        Checks if the given number of flows may be emitted.
      • state

        public abstract long state()
        The current limiter state. Stored in checkmarks.
      • of

        public static Limiter of​(long flowsPerSecond)
      • restore

        public static Limiter restore​(long flowsPerSecond,
                                      long limiterState)
      • restore

        public static Limiter restore​(long flowsPerSecond,
                                      long limiterState,
                                      Supplier<Long> currentTimeMillis)