Package com.apple.foundationdb.async
Interface CloseableAsyncIterator<T>
- Type Parameters:
T
- the type of object yielded bynext()
- All Superinterfaces:
AsyncIterator<T>
,AutoCloseable
,Iterator<T>
A version of
AsyncIterator
that must be closed once no longer in use in order to free
any associated resources.-
Method Summary
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 interfaceAutoCloseable
-
cancel
default void cancel()Alias forclose()
.- Specified by:
cancel
in interfaceAsyncIterator<T>
-