Package org.infinispan.util
Class Closeables
- java.lang.Object
-
- org.infinispan.util.Closeables
-
public class Closeables extends Object
This class is used solely for the purpose of converting classes only in core to corresponding closeable variants.- Since:
- 9.3
- Author:
- wburns
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E> CloseableIterator<E>
iterator(org.reactivestreams.Publisher<E> publisher, int fetchSize)
Converts aPublisher
to aCloseableIterator
by utilizing items fetched into an array and refetched as they are consumed from the iterator.
-
-
-
Method Detail
-
iterator
public static <E> CloseableIterator<E> iterator(org.reactivestreams.Publisher<E> publisher, int fetchSize)
Converts aPublisher
to aCloseableIterator
by utilizing items fetched into an array and refetched as they are consumed from the iterator. The iterator when closed will also close the underlyingSubscription
when subscribed to the publisher.- Type Parameters:
E
- value type- Parameters:
publisher
- the publisher to convertfetchSize
- how many entries to hold in memory at once in preparation for the iterators consumption- Returns:
- an iterator that when closed will cancel the subscription
-
-