Class FixedDemandPacer

java.lang.Object
io.smallrye.mutiny.subscription.FixedDemandPacer
All Implemented Interfaces:
DemandPacer

public class FixedDemandPacer extends Object implements DemandPacer
A demand pacer with a fixed delay / fixed demand.
  • Constructor Details

    • FixedDemandPacer

      public FixedDemandPacer(long demand, Duration delay)
  • Method Details

    • initial

      public DemandPacer.Request initial()
      Description copied from interface: DemandPacer
      Get the initial request.

      This will be called at the Multi.paceDemand() operator subscription time.

      Specified by:
      initial in interface DemandPacer
      Returns:
      the request, must not be null
    • 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