Conversation
…rget to `.net8.0`
| private readonly ChannelReader<object> _channelReader; | ||
| private readonly CancellationTokenSource _disposeCts; | ||
| private readonly Task _backgroundTask; | ||
| private int _enumerated; // 0 = not yet, 1 = already enumerated |
There was a problem hiding this comment.
Nit: not immediately obvious that these are ints not booleans due to the use of InterLocked and restrictions prior to .NET 9.
| public async Task<ResponseMessage<List<object>>> ReadValueAsync(MemoryStream stream, | ||
| GraphBinaryReader reader, CancellationToken cancellationToken = default) | ||
| /// <returns>An async enumerable of deserialized result objects.</returns> | ||
| public async IAsyncEnumerable<object> ReadStreamingAsync(Stream stream, |
There was a problem hiding this comment.
This class is the ResponseMessageSerializer, but it no longer returns a ResponseMessage. This probably require some restructuring. Is ResponseMessage needed at all anymore?
There was a problem hiding this comment.
No, ResponseMessage was deleted. I'll update naming & stuff for this one.
| /// <param name="cancellationToken">The token to cancel the operation. The default value is None.</param> | ||
| /// <returns>The read <see cref="byte"/>.</returns> | ||
| public static async Task<byte> ReadByteAsync(this Stream stream, CancellationToken cancellationToken = default) | ||
| public static async ValueTask<byte> ReadByteAsync(this Stream stream, |
There was a problem hiding this comment.
Nit: These types of changes exist throughout the PR that are just spacing changes, but the make the diff hard to read. Can these be reverted?
There was a problem hiding this comment.
I mean the change from Task to ValueTask is a valid change but was the line break necessary?
There was a problem hiding this comment.
It was a styling nit for line length that's auto applied.
…used `StatusAttributes` API
Updated .NET driver to support streaming HTTP responses. Changes include:
Non-breaking:
Connection.SubmitAsyncusesResponseHeadersRead+ backgroundTask+Channel<object>to stream results incrementallyResponseMessageSerializeryields results viaIAsyncEnumerable<object>instead of buffering intoList<object>StreamExtensionsreads useReadExactlyAsyncfor EOF safety, reads and writes useBinaryPrimitivesNext(),ToList(),HasNext(), etc.) unchanged, blocks internally viaWaitUnwrap()Breaking:
ResultSet<T>rebuilt asIAsyncEnumerable<T>(wasIReadOnlyCollection<T>).Countand syncforeachremoved, useToListAsync()orawait foreachIMessageSerializer.DeserializeMessageAsyncacceptsStream→IAsyncEnumerable<object>(wasbyte[]→Task<ResponseMessage<List<object>>>). Custom serializers must updateResponseMessage<T>deletedResponseExceptionthrown during result iteration, not duringSubmitAsync, for directResultSet<T>consumersITraversal.Traverserschanged fromIEnumerable<Traverser>toIAsyncEnumerable<Traverser>;IEnumeratorinheritance removed (Reset()gone)netstandard2.0;net6.0)VOTE +1