Class PriorityMergingProcessor<T>

  • All Implemented Interfaces:
    AutoCloseable, Iterable<T>, org.infinispan.commons.util.CloseableIterable<T>

    public class PriorityMergingProcessor<T>
    extends Object
    implements org.infinispan.commons.util.CloseableIterable<T>
    An iterable that will automatically poll entries from the given publishers. Entries are first attempted to be returned from the first publisher and so forth. If no publisher has recently published an entry the iterator will block until one does so or all are known to have completed.

    The iterator returned should be closed by the user when they are done to ensure resources are freed properly.

    Since:
    9.0
    Author:
    wburns
    • Method Detail

      • build

        public static <T> PriorityMergingProcessor<T> build​(org.reactivestreams.Publisher<T> publisher,
                                                            int firstbatchSize,
                                                            org.reactivestreams.Publisher<T> secondPublisher,
                                                            int secondBatchSize)
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface org.infinispan.commons.util.CloseableIterable<T>
      • iterator

        public org.infinispan.commons.util.CloseableIterator<T> iterator()
        Specified by:
        iterator in interface org.infinispan.commons.util.CloseableIterable<T>
        Specified by:
        iterator in interface Iterable<T>