-
public interface StreamThrottlePolicyThrottle strategy that controls when values are delivered within a time window.
Leading — First value in the window is delivered immediately. Subsequent values are dropped until the window expires.
submit: A---B-C-D-----------E-F--- output: A--------------------E----- |--- windowMs ---| |--- windowMs ---|Trailing — Values are collected during the window. Only the last value is delivered when the window expires.
submit: A---B-C-D-----------E-F--- output: -----------D--------------F |--- windowMs ---| |--- windowMs ---|LeadingAndTrailing — First value delivered immediately. The last value in the window is also delivered when the window expires (if different from the leading value).
submit: A---B-C-D-----------E-F--- output: A----------D--------E----F |--- windowMs ---| |--- windowMs ---|
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classStreamThrottlePolicy.LeadingFirst value passes immediately; subsequent values within the window are dropped.
public final classStreamThrottlePolicy.TrailingValues collected during the window; only the last value is delivered when the window expires.
public final classStreamThrottlePolicy.LeadingAndTrailingFirst value passes immediately; the last value is also delivered when the window expires (if a newer value was submitted during the window).
public classStreamThrottlePolicy.CompanionFactory methods for creating StreamThrottlePolicy instances.
-
Method Summary
Modifier and Type Method Description abstract LonggetWindowMs()Minimum time in milliseconds between accepted values. -
-
Method Detail
-
getWindowMs
abstract Long getWindowMs()
Minimum time in milliseconds between accepted values.
-
-
-
-