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

    Modifier and Type
    Method
    Description
    static <E> org.infinispan.commons.util.CloseableIterator<E>
    iterator(org.reactivestreams.Publisher<E> publisher, int fetchSize)
    Deprecated.
    since 11.0 Please use Closeables.iterator(Publisher, int) instead.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • iterator

      @Deprecated public static <E> org.infinispan.commons.util.CloseableIterator<E> iterator(org.reactivestreams.Publisher<E> publisher, int fetchSize)
      Deprecated.
      since 11.0 Please use Closeables.iterator(Publisher, int) instead.
      Converts a Publisher to a CloseableIterator by utilizing items fetched into an array and refetched as they are consumed from the iterator. The iterator when closed will also close the underlying Subscription when subscribed to the publisher.
      Type Parameters:
      E - value type
      Parameters:
      publisher - the publisher to convert
      fetchSize - 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