OpenAI: investigation for StreamingClientResult<T>#39
OpenAI: investigation for StreamingClientResult<T>#39annelo-msft wants to merge 2 commits intojoseharriaga:mainfrom
Conversation
| public class StreamingClientResult<T> | ||
| : IDisposable | ||
| , IAsyncEnumerable<T> | ||
| internal class StreamingEventResult<T> : StreamingClientResult<T> |
There was a problem hiding this comment.
This type becomes internal.
| _disposedValue = true; | ||
| } | ||
| } | ||
| // TODO: Handle disposal via Enumerator? Validate that this will work. |
There was a problem hiding this comment.
This is an open question we'll still need to resolve - whether or not to make StreamingClientResult implement IDisposable.
There was a problem hiding this comment.
From the earlier-era Toub discussions, I think we'll end up needing IDisposable (or have a variant, equivalent mechanism, or whatever else). We looked at the option of implicitly using the end of enumeration as the sole disposal mechanism (and the existing implementation does opportunistically do it at the end of enumeration), but the ergonomics around making that an explicit lifetime requirement were unfavorably received. I think Krzysztof also mentioned that leaving an unbuffered response floating was a substantial issue.
Depends on this change to ClientModel: Azure/azure-sdk-for-net#42873