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
TType the enumerator is for.
- Inheritance
-
ObservableAsyncEnumerator<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
ObservableAsyncEnumerator(IObservable<T>, CancellationToken)
Initializes a new instance of the ObservableAsyncEnumerator<T> class.
public ObservableAsyncEnumerator(IObservable<T> observable, CancellationToken cancellationToken)
Parameters
observableIObservable<T>The observable to return from.
cancellationTokenCancellationTokenCancellation 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
trueif the enumerator was successfully advanced to the next element, orfalseif the enumerator has passed the end of the collection.