Package 

Class ThrottleManager


  • 
    public final class ThrottleManager
    
                        

    Rate limiter that allows up to maxEventsPerHour events within a sliding 1-hour window. Thread-safe implementation suitable for concurrent access.

    • Method Summary

      Modifier and Type Method Description
      final Boolean tryAcquire() Attempts to acquire a permit for sending an event.
      • Methods inherited from class java.lang.Object

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

      • ThrottleManager

        ThrottleManager(Integer maxEventsPerHour, Function0<Long> now)
    • Method Detail

      • tryAcquire

         final Boolean tryAcquire()

        Attempts to acquire a permit for sending an event.