Description
With #56079, native AOT support for SignalR client was added. But one scenario that isn't supported is to use "streaming" APIs (IAsyncEnumerable<T>
and ChannelReader<T>
) with ValueTypes. In order to work with IAsyncEnumerable<T>
and ChannelReader<T>
we either need to "jump" to a <T>
generic method (which is what it does today, and not supported with native AOT because it can't generate the code up front) or by using reflection to invoke the MoveNextAsync()
and WaitToReadAsync()
methods.
It was decided to not support this scenario until we get data that shows we need to implement this in SignalR.
Note that using ValueTypes in these scenarios isn't necessarily a performance gain because the T
will be boxed (i.e. an allocation will occur) into the StreamItemMessage
in:
aspnetcore/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs
Lines 856 to 858 in 206b0ae