Table of Contents

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

T

The 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

wrappedAsyncEnumerable IAsyncEnumerable<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

disposing bool

A value indicating whether the method has been called by the Dispose method and not from the finalizer.

GetAsyncEnumerator(CancellationToken)

public IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

IAsyncEnumerator<T>