Table of Contents

Class JNetAsyncEnumerator<TObject>

Namespace
MASES.JNet.Specific
Assembly
MASES.JNet.dll

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
JNetAsyncEnumerator<TObject>
Implements
IEnumerator<TObject>
Inherited Members

Constructors

JNetAsyncEnumerator(IJavaObject, IEnumerableExtension, CancellationToken)

public JNetAsyncEnumerator(IJavaObject refObj, IEnumerableExtension extension, CancellationToken cancellationToken)

Parameters

refObj IJavaObject

Reference to IJavaObject implementing Java Iterator

extension IEnumerableExtension

Extension from JVMBridgeBaseEnumerable<TClass>

cancellationToken CancellationToken

CancellationToken to use in the iteration

Methods

DoWorkCycle()

true to advance in iterator, false to stop

protected override bool DoWorkCycle()

Returns

bool

true to execute a get cycle, false to stop

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, or false if the enumerator has passed the end of the collection.