Class ObservableAsyncEnumerator<T>
- Namespace
- Cratis.Applications.Queries
- Assembly
- Cratis.Applications.dll
Represents an IAsyncEnumerator<T> for a ClientObservable<T>.
public class ObservableAsyncEnumerator<T> : IAsyncEnumerator<T>, IAsyncDisposable
Type Parameters
T
Type the enumerator is for.
- Inheritance
-
ObservableAsyncEnumerator<T>
- Implements
- Inherited Members
Constructors
ObservableAsyncEnumerator(IObservable<T>, CancellationToken)
Initializes a new instance of the ObservableAsyncEnumerator<T> class.
public ObservableAsyncEnumerator(IObservable<T> observable, CancellationToken cancellationToken)
Parameters
observable
IObservable<T>The observable to return from.
cancellationToken
CancellationTokenCancellation token for cancelling any enumeration.
Properties
Current
Gets the element in the collection at the current position of the enumerator.
public T Current { get; }
Property Value
- T
The element in the collection at the current position of the enumerator.
Methods
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
Returns
- ValueTask
A task that represents the asynchronous dispose operation.
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.