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
TObject
The returning type of the iterator
- Inheritance
-
JVMBridgeBasePrefetchableEnumerator<TObject>JNetAsyncEnumerator<TObject>
- Implements
-
IEnumerator<TObject>IAsyncEnumerator<TObject>
- Inherited Members
Constructors
JNetAsyncEnumerator(IJavaObject, IEnumerableExtension, CancellationToken)
Initialize a new JNetAsyncEnumerator<TObject>
public JNetAsyncEnumerator(IJavaObject refObj, IEnumerableExtension extension, CancellationToken cancellationToken)
Parameters
refObj
IJavaObjectReference to IJavaObject implementing Java Iterator
extension
IEnumerableExtensionExtension from JVMBridgeBaseEnumerable<TClass>
cancellationToken
CancellationTokenCancellationToken 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
true
if the enumerator was successfully advanced to the next element, orfalse
if the enumerator has passed the end of the collection.