Interface BackpressureDrainManager.BackpressureQueueCallback

  • Enclosing class:
    BackpressureDrainManager


    public static interface BackpressureDrainManager.BackpressureQueueCallback
    Interface representing the minimal callbacks required to operate the drain part of a backpressure system.
    • Method Summary

      Modifier and Type Method and Description
      boolean accept(Object value)
      Override this method to deliver an element to downstream.
      void complete(Throwable exception)
      Override this method to deliver a normal or exceptional terminal event.
      Object peek()
      Override this method to peek for the next element, null meaning no next element available now.
      Object poll()
      Override this method to poll (consume) the next element, null meaning no next element available now.
    • Method Detail

      • peek

        Object peek()
        Override this method to peek for the next element, null meaning no next element available now.

        It will be called plain and while holding this object's monitor.

        Returns:
        the next element or null if no next element available
      • poll

        Object poll()
        Override this method to poll (consume) the next element, null meaning no next element available now.
        Returns:
        the next element or null if no next element available
      • accept

        boolean accept(Object value)
        Override this method to deliver an element to downstream. The logic ensures that this happens only in the right conditions.
        Parameters:
        value - the value to deliver, not null
        Returns:
        true indicates that one should terminate the emission loop unconditionally and not deliver any further elements or terminal events.
      • complete

        void complete(Throwable exception)
        Override this method to deliver a normal or exceptional terminal event.
        Parameters:
        exception - if not null, contains the terminal exception