Package com.apple.foundationdb.async
Interface CloseableAsyncIterator<T>
-
- Type Parameters:
T
- the type of object yielded bynext()
- All Superinterfaces:
AsyncIterator<T>
,java.lang.AutoCloseable
,java.util.Iterator<T>
public interface CloseableAsyncIterator<T> extends java.lang.AutoCloseable, AsyncIterator<T>
A version ofAsyncIterator
that must be closed once no longer in use in order to free any associated resources.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
cancel()
Alias forclose()
.void
close()
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
-
-
-
-
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 interfacejava.lang.AutoCloseable
-
cancel
default void cancel()
Alias forclose()
.- Specified by:
cancel
in interfaceAsyncIterator<T>
-
-