Interface CloseableAsyncIterator<T>

Type Parameters:
T - the type of object yielded by next()
All Superinterfaces:
AsyncIterator<T>, AutoCloseable, Iterator<T>

public interface CloseableAsyncIterator<T> extends AutoCloseable, AsyncIterator<T>
A version of AsyncIterator that must be closed once no longer in use in order to free any associated resources.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Alias for close().
    void
    Cancels any outstanding asynchronous work, closes the iterator, and frees any associated resources.

    Methods inherited from interface com.apple.foundationdb.async.AsyncIterator

    hasNext, next, onHasNext

    Methods inherited from interface java.util.Iterator

    forEachRemaining, remove
  • Method Details

    • close

      void close()
      Cancels any outstanding asynchronous work, closes the iterator, and frees any associated resources. This must be called at least once after the object is no longer in use. This can be called multiple times, but care should be taken that an object is not in use in another thread at the time of the call.
      Specified by:
      close in interface AutoCloseable
    • cancel

      default void cancel()
      Alias for close().
      Specified by:
      cancel in interface AsyncIterator<T>