ClientModel: investigation for StreamingClientResult<T>#42873
ClientModel: investigation for StreamingClientResult<T>#42873annelo-msft wants to merge 1 commit intoAzure:mainfrom
Conversation
| public static ClientResult<T?> FromOptionalValue<T>(T? value, PipelineResponse response) | ||
| => new ClientResult<T?>(value, response); | ||
|
|
||
| //public static StreamingClientResult<T> FromStreamingValue<T>(T value, PipelineResponse response) |
There was a problem hiding this comment.
I was considering this, but I don't think we can provide it without a non-abstract implementation in ClientModel. It would be the responsibility of the client's concrete subtype to provide such a factory method.
| namespace System.ClientModel; | ||
|
|
||
| #pragma warning disable CS1591 // public XML comments | ||
| public abstract class StreamingClientResult<T> : ClientResult, IAsyncEnumerable<T> |
There was a problem hiding this comment.
The only thing this does is abstractly implement the IAsyncEnumerable<T> interface, and provide a protected constructor that calls through to the base constructor.
We still have an open question of whether this should implement IDisposable to make it easy to dispose the response content stream by putting this result in a using block, but I'm interested to first investigate how hard it is to use the IAsyncDisposable interface implementation in the IAsyncEnumerator returned from GetAsyncEnumerator.
|
Closing in favor of #43392 |
No description provided.