Class JNetAsyncEnumerator<TObject>
An extension of JVMBridgeBasePrefetchableEnumerator<TObject> implementing IAsyncEnumerator<T> used to manage Java Iterator in async way
public class JNetAsyncEnumerator<TObject> : JVMBridgeBasePrefetchableEnumerator<TObject>, IEnumerator<TObject>, IDisposable, IEnumerator, IAsyncEnumerator<TObject>, IAsyncDisposable
Type Parameters
TObjectThe returning type of the iterator
- Inheritance
-
JVMBridgeBasePrefetchableEnumerator<TObject>JNetAsyncEnumerator<TObject>
- Implements
-
IEnumerator<TObject>IAsyncEnumerator<TObject>
- Inherited Members
-
JVMBridgeBasePrefetchableEnumerator.TryFinallyProtection
Constructors
JNetAsyncEnumerator(IJavaObject, IEnumerableExtension, CancellationToken)
Initialize a new JNetAsyncEnumerator<TObject>
public JNetAsyncEnumerator(IJavaObject refObj, IEnumerableExtension extension, CancellationToken cancellationToken)
Parameters
refObjIJavaObjectReference to IJavaObject implementing Java Iterator
extensionIEnumerableExtensionExtension from JVMBridgeBaseEnumerable<TClass>
cancellationTokenCancellationTokenCancellationToken to use in the iteration
Methods
DoWorkCycle()
protected override bool DoWorkCycle()
Returns
Remarks
If the get loop shall wait on some external conditions, override the function and block within it
MoveNextAsync()
Advances the enumerator asynchronously to the next element of the collection.
public ValueTask<bool> MoveNextAsync()
Returns
- ValueTask<bool>
A ValueTask<TResult> that will complete with a result of
trueif the enumerator was successfully advanced to the next element, orfalseif the enumerator has passed the end of the collection.