Class ReorderingConcurrentResultBuffer

  • All Implemented Interfaces:
    CanFilterResultValue, Output, java.lang.AutoCloseable

    public class ReorderingConcurrentResultBuffer
    extends java.lang.Object
    implements Output, CanFilterResultValue
    This will implement a result buffer that puts cycles in order when possible, according to a sliding window.
    • Constructor Detail

      • ReorderingConcurrentResultBuffer

        public ReorderingConcurrentResultBuffer​(Output downstream)
      • ReorderingConcurrentResultBuffer

        public ReorderingConcurrentResultBuffer​(Output downstream,
                                                int threshold)
    • Method Detail

      • onCycleResult

        public boolean onCycleResult​(long completedCycle,
                                     int result)
        Description copied from interface: Output
        Mark the result of the numbered cycle with an integer value. The meaning of the value provided is contextual to the way it is used. (Each process will have its own status tables, etc.)
        Specified by:
        onCycleResult in interface Output
        Parameters:
        completedCycle - The cycle number being marked.
        result - the result ordinal
        Returns:
        true on success, false if the marking should be retried differently
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface Output
        Throws:
        java.lang.Exception