Interface DemandPacer

  • All Known Implementing Classes:
    FixedDemandPacer

    public interface DemandPacer
    Interface for Multi demand pacers and the Multi.paceDemand() operator.

    A demand-pacer allows controlling upstream demand using a request and a delay. Each time the delay expires the pacer can evaluate a new demand based on the previous request and the number of emitted items that have been observed since the previous request.

    The FixedDemandPacer offers a fixed delay / fixed demand implementation, but custom / adaptive strategies can be provided through this DemandPacer interface.

    • Method Detail

      • apply

        DemandPacer.Request apply​(DemandPacer.Request previousRequest,
                                  long observedItemsCount)
        Evaluate the next request after the previous request delay has expired.
        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