AsyncStreamingClientResult<T> Class

Definition

Represents an asynchronous sequence of values read from a streaming service response.

public sealed class AsyncStreamingClientResult<T> : IAsyncDisposable, System.Collections.Generic.IAsyncEnumerable<T>
type AsyncStreamingClientResult<'T> = class
    interface IAsyncEnumerable<'T>
    interface IAsyncDisposable
Public NotInheritable Class AsyncStreamingClientResult(Of T)
Implements IAsyncDisposable, IAsyncEnumerable(Of T)

Type Parameters

T

The type of values in the response stream.

Inheritance
AsyncStreamingClientResult<T>
Implements

Remarks

An AsyncStreamingClientResult<T> can be enumerated only once. Disposing the enumerator or the result disposes the underlying response. The operation cancellation token remains active for the lifetime of the stream and is combined with the token supplied when enumeration begins. Custom producers must observe cancellation or stream closure to terminate; code that ignores both cannot be forcibly stopped by this abstraction. Enumerating a disposed result throws ObjectDisposedException; requesting a second enumerator throws InvalidOperationException.

Properties

Name Description
Headers

Gets the headers of the service response.

ReasonPhrase

Gets the reason phrase of the service response.

Status

Gets the status code of the service response.

Methods

Name Description
DisposeAsync()

Asynchronously disposes the result and its response.

Explicit Interface Implementations

Name Description
IAsyncEnumerable<T>.GetAsyncEnumerator(CancellationToken)

Returns an enumerator that iterates asynchronously through the collection.

Applies to