Package org.infinispan.stream.impl
Class PriorityMergingProcessor<T>
- java.lang.Object
-
- org.infinispan.stream.impl.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PriorityMergingProcessor.Builder<T>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> PriorityMergingProcessor<T>
build(org.reactivestreams.Publisher<T> publisher, int firstbatchSize, org.reactivestreams.Publisher<T> secondPublisher, int secondBatchSize)
static <T> PriorityMergingProcessor.Builder<T>
builder()
void
close()
org.infinispan.commons.util.CloseableIterator<T>
iterator()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
build
public static <T> PriorityMergingProcessor<T> build(org.reactivestreams.Publisher<T> publisher, int firstbatchSize, org.reactivestreams.Publisher<T> secondPublisher, int secondBatchSize)
-
builder
public static <T> PriorityMergingProcessor.Builder<T> builder()
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceorg.infinispan.commons.util.CloseableIterable<T>
-
-