Class FixedDemandPacer

  • All Implemented Interfaces:
    DemandPacer

    @Experimental("Demand pacing is a new experimental API introduced in Mutiny 1.5.0")
    public class FixedDemandPacer
    extends java.lang.Object
    implements DemandPacer
    A demand pacer with a fixed delay / fixed demand.
    • Constructor Detail

      • FixedDemandPacer

        public FixedDemandPacer​(long demand,
                                java.time.Duration delay)
    • Method Detail

      • apply

        public DemandPacer.Request apply​(DemandPacer.Request previousRequest,
                                         long observedItemsCount)
        Description copied from interface: DemandPacer
        Evaluate the next request after the previous request delay has expired.
        Specified by:
        apply in interface DemandPacer
        Parameters:
        previousRequest - the previous request
        observedItemsCount - the number of emitted items that have been observed since the last request
        Returns:
        the request, must not be null