Package org.infinispan.util
Class Closeables
java.lang.Object
org.infinispan.util.Closeables
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
Modifier and TypeMethodDescriptionstatic <E> CloseableIterator
<E> iterator
(org.reactivestreams.Publisher<E> publisher, int fetchSize) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
iterator
@Deprecated(forRemoval=true, since="11.0") public static <E> CloseableIterator<E> iterator(org.reactivestreams.Publisher<E> publisher, int fetchSize) Deprecated, for removal: This API element is subject to removal in a future version.since 11.0 Please useCloseables.iterator(Publisher, int)
instead.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
-
Closeables.iterator(Publisher, int)
instead.