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, scala.concurrent.duration.FiniteDuration per)  
      ThrottleControl​(int cost, scala.concurrent.duration.FiniteDuration per, int maximumBurst, ThrottleMode mode)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCost()
      Speed is limited to cost/per.
      scala.concurrent.duration.FiniteDuration getPer()
      Speed is limited to cost/per.
      void initIfNotShared()  
      ThrottleMode mode()  
      void update​(int cost, scala.concurrent.duration.FiniteDuration 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,
                               scala.concurrent.duration.FiniteDuration per)
      • ThrottleControl

        public ThrottleControl​(int cost,
                               scala.concurrent.duration.FiniteDuration per,
                               int maximumBurst,
                               ThrottleMode mode)
    • Method Detail

      • getCost

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

        public scala.concurrent.duration.FiniteDuration getPer()
        Speed is limited to cost/per. This is the current per duration.
      • initIfNotShared

        public void initIfNotShared()
      • update

        public void update​(int cost,
                           scala.concurrent.duration.FiniteDuration per)