- java.lang.Object
-
- io.smallrye.mutiny.subscription.FixedDemandPacer
-
- All Implemented Interfaces:
DemandPacer
public class FixedDemandPacer extends java.lang.Object implements DemandPacer
A demand pacer with a fixed delay / fixed demand.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.smallrye.mutiny.subscription.DemandPacer
DemandPacer.Request
-
-
Constructor Summary
Constructors Constructor Description FixedDemandPacer(long demand, java.time.Duration delay)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DemandPacer.Requestapply(DemandPacer.Request previousRequest, long observedItemsCount)Evaluate the next request after the previous request delay has expired.DemandPacer.Requestinitial()Get the initial request.
-
-
-
Method Detail
-
initial
public DemandPacer.Request initial()
Description copied from interface:DemandPacerGet the initial request.This will be called at the
Multi.paceDemand()operator subscription time.- Specified by:
initialin interfaceDemandPacer- Returns:
- the request, must not be
null
-
apply
public DemandPacer.Request apply(DemandPacer.Request previousRequest, long observedItemsCount)
Description copied from interface:DemandPacerEvaluate the next request after the previous request delay has expired.- Specified by:
applyin interfaceDemandPacer- Parameters:
previousRequest- the previous requestobservedItemsCount- the number of emitted items that have been observed since the last request- Returns:
- the request, must not be
null
-
-