You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support IAsyncEnumerable<T> and ChannelReader<T> with ValueTypes in SignalR native AOT
Support streaming ValueTypes from a SignalR Hub method in both the client and the server in native AOT. In order to make this work, we need to use pure reflection to read from the streaming object.
Support passing in an IAsyncEnumerable/ChannelReader of ValueType to a parameter in SignalR.Client. This works because the user code creates the concrete object, and the SignalR.Client library just needs to read from it using reflection.
The only scenario that can't be supported is on the SignalR server we can't support receiving an IAsyncEnumerable/ChannelReader of ValueType. This is because there is no way for the SignalR library code to construct a concrete instance to pass into the user-defined method on native AOT.
Fixdotnet#56179
Justification="There is a runtime check for ValueType streaming item type when PublishAot=true. Developers will get an exception in this situation before publishing.")]
860
+
Justification="ValueTypes are handled without using MakeGenericMethod.")]
// NativeAOT apps are not able to stream IAsyncEnumerable and ChannelReader of ValueTypes
869
-
// since we cannot create SendStreamItems and SendIAsyncEnumerableStreamItems methods with a generic ValueType.
870
-
thrownewInvalidOperationException($"Unable to stream an item with type '{genericTypes[0]}' because it is a ValueType. Native code to support streaming this ValueType will not be available with native AOT.");
0 commit comments