Interface CloseableAsyncIterator<T>

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

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

      • 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 java.lang.AutoCloseable