<PackageReference Include="Grpc.Core.Api" Version="2.71.0-pre1" />

Grpc.Core.AsyncServerStreamingCall<TResponse>

public sealed class AsyncServerStreamingCall<TResponse> : IDisposable
Return type for server streaming calls.

Asynchronous access to response headers.

public IAsyncStreamReader<TResponse> ResponseStream { get; }

Async stream to read streaming responses.

public AsyncServerStreamingCall(IAsyncStreamReader<TResponse> responseStream, Task<Metadata> responseHeadersAsync, Func<Status> getStatusFunc, Func<Metadata> getTrailersFunc, Action disposeAction)

Creates a new AsyncDuplexStreamingCall object with the specified properties.

public AsyncServerStreamingCall(IAsyncStreamReader<TResponse> responseStream, Func<object, Task<Metadata>> responseHeadersAsync, Func<object, Status> getStatusFunc, Func<object, Metadata> getTrailersFunc, Action<object> disposeAction, object state)

Creates a new AsyncDuplexStreamingCall object with the specified properties.

public void Dispose()

Provides means to cleanup after the call. If the call has already finished normally (response stream has been fully read), doesn't do anything. Otherwise, requests cancellation of the call which should terminate all pending async operations associated with the call. As a result, all resources being used by the call should be released eventually.

public Status GetStatus()

Gets the call status if the call has already finished. Throws InvalidOperationException otherwise.

Gets the call trailing metadata if the call has already finished. Throws InvalidOperationException otherwise.