Class SimpleBucketListener

    • Constructor Detail

      • SimpleBucketListener

        public SimpleBucketListener()
    • Method Detail

      • onConsumed

        public void onConsumed​(long tokens)
        Description copied from interface: BucketListener
        This method is called whenever tokens is consumed.
        Specified by:
        onConsumed in interface BucketListener
        Parameters:
        tokens - amount of tokens that consumed
      • onRejected

        public void onRejected​(long tokens)
        Description copied from interface: BucketListener
        This method is called whenever consumption request for tokens is rejected.
        Specified by:
        onRejected in interface BucketListener
        Parameters:
        tokens - amount of tokens that rejected
      • onDelayed

        public void onDelayed​(long nanos)
        Description copied from interface: BucketListener
        This method is called each time when delayed task was submit to ScheduledExecutorService because of wait for tokens refill in result of interaction with SchedulingBucket
        Specified by:
        onDelayed in interface BucketListener
        Parameters:
        nanos - amount of nanoseconds for which thread was parked
      • onParked

        public void onParked​(long nanos)
        Description copied from interface: BucketListener
        This method is called each time when thread was parked for wait of tokens refill in result of interaction with BlockingBucket
        Specified by:
        onParked in interface BucketListener
        Parameters:
        nanos - amount of nanoseconds for which thread was parked
      • getConsumed

        public long getConsumed()
      • getRejected

        public long getRejected()
      • getDelayedNanos

        public long getDelayedNanos()
      • getParkedNanos

        public long getParkedNanos()
      • getInterrupted

        public long getInterrupted()