-
public final class BackPressureStrategy
-
-
Field Summary
Fields Modifier and Type Field Description private final Integercapacityprivate final Function0<Unit>onThresholdReachedprivate final Function1<Object, Unit>onItemDroppedprivate final BackPressureMitigationbackpressureMitigation
-
Constructor Summary
Constructors Constructor Description BackPressureStrategy(Integer capacity, Function0<Unit> onThresholdReached, Function1<Object, Unit> onItemDropped, BackPressureMitigation backpressureMitigation)
-
Method Summary
Modifier and Type Method Description final IntegergetCapacity()final Function0<Unit>getOnThresholdReached()final Function1<Object, Unit>getOnItemDropped()final BackPressureMitigationgetBackpressureMitigation()-
-
Constructor Detail
-
BackPressureStrategy
BackPressureStrategy(Integer capacity, Function0<Unit> onThresholdReached, Function1<Object, Unit> onItemDropped, BackPressureMitigation backpressureMitigation)
- Parameters:
capacity- the maximum size of the queueonThresholdReached- callback called when the queue reaches full capacityonItemDropped- called when an item is dropped because of this backpressure strategybackpressureMitigation- the mitigation to use when reaching the capacity
-
-
Method Detail
-
getCapacity
final Integer getCapacity()
-
getOnThresholdReached
final Function0<Unit> getOnThresholdReached()
-
getOnItemDropped
final Function1<Object, Unit> getOnItemDropped()
-
getBackpressureMitigation
final BackPressureMitigation getBackpressureMitigation()
-
-
-
-