Class AsyncStreamAdapter<T> (4.4.0)

public sealed class AsyncStreamAdapter<T> : IAsyncStreamReader<T>

Simple adapter to allow an IAsyncEnumerator<T> to be used as a gRPC IAsyncStreamReader<T>. Note that cancellation is not fully supported, due to differences between the two interfaces.

Inheritance

object > AsyncStreamAdapter<T>

Implements

IAsyncStreamReader

Namespace

Google.Api.Gax.Grpc.Testing

Assembly

Google.Api.Gax.Grpc.Testing.dll

Type Parameter

NameDescription
T

The element type.

Constructors

AsyncStreamAdapter(IAsyncEnumerator<T>)

public AsyncStreamAdapter(IAsyncEnumerator<T> enumerator)

Wraps the given async enumerator as an async stream reader.

Parameter
NameDescription
enumeratorIAsyncEnumerator

The enumerator to wrap

Properties

Current

public T Current { get; }
Property Value
TypeDescription
T

Methods

MoveNext(CancellationToken)

public Task<bool> MoveNext(CancellationToken cancellationToken)
Parameter
NameDescription
cancellationTokenCancellationToken
Returns
TypeDescription
Taskbool