Class ThrottleControl


  • public final class ThrottleControl
    extends java.lang.Object
    Control the throttle rate from the outside of the stream, or share a common throttle rate across several streams.
    • Constructor Summary

      Constructors 
      Constructor Description
      ThrottleControl​(int cost, java.time.Duration per)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCost()
      Speed is limited to cost/per.
      java.time.Duration getPer()
      Speed is limited to cost/per.
      ThrottleMode mode()  
      void update​(int cost, java.time.Duration per)  
      • Methods inherited from class java.lang.Object

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

      • ThrottleControl

        public ThrottleControl​(int cost,
                               java.time.Duration per)
    • Method Detail

      • getCost

        public int getCost()
        Speed is limited to cost/per. This is the current cost.
      • getPer

        public java.time.Duration getPer()
        Speed is limited to cost/per. This is the current per duration.
      • update

        public void update​(int cost,
                           java.time.Duration per)