Class WindowRateControl
java.lang.Object
org.eclipse.jetty.http2.WindowRateControl
- All Implemented Interfaces:
- RateControl
An implementation of RateControl that limits the number of
events within a time period.
Events are kept in a queue and for each event the queue is first
drained of the old events outside the time window, and then the new
event is added to the queue. The size of the queue is maintained
separately in an AtomicInteger and if it exceeds the max
number of events then onEvent(Object) returns false.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields inherited from interface RateControlNO_RATE_CONTROL
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic WindowRateControlfromEventsPerSecond(int maxEvents) intbooleanApplications should call this method when they want to signal an event that is subject to rate control.
- 
Constructor Details- 
WindowRateControl
 
- 
- 
Method Details- 
fromEventsPerSecond
- 
getEventsPerSecondpublic int getEventsPerSecond()
- 
onEventDescription copied from interface:RateControlApplications should call this method when they want to signal an event that is subject to rate control. Implementations should return true if the event does not exceed the desired rate, or false to signal that the event exceeded the desired rate. - Specified by:
- onEventin interface- RateControl
- Parameters:
- event- the event subject to rate control.
- Returns:
- true IFF the rate is within limits
 
 
-