Class DisposableAsyncEnumerable<T>
- Namespace
- Silverback.Util
- Assembly
- Silverback.Core.dll
Wraps an IAsyncEnumerable<T> and can (and must) be disposed after enumeration.
public class DisposableAsyncEnumerable<T> : IDisposableAsyncEnumerable<T>, IAsyncEnumerable<T>, IDisposable
Type Parameters
TThe type of the elements in the collection.
- Inheritance
-
DisposableAsyncEnumerable<T>
- Implements
- Inherited Members
Constructors
DisposableAsyncEnumerable(IAsyncEnumerable<T>)
Initializes a new instance of the DisposableAsyncEnumerable<T> class.
public DisposableAsyncEnumerable(IAsyncEnumerable<T> wrappedAsyncEnumerable)
Parameters
wrappedAsyncEnumerableIAsyncEnumerable<T>The IAsyncEnumerable<T> to be wrapped.
Methods
Dispose()
public void Dispose()
Dispose(bool)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
protected virtual void Dispose(bool disposing)
Parameters
disposingboolA value indicating whether the method has been called by the
Disposemethod and not from the finalizer.
GetAsyncEnumerator(CancellationToken)
public IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken