-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Client to Server Streaming with IAsyncEnumerable #9310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
#if NETCOREAPP3_0 | ||
if (ReflectionHelper.IsIAsyncEnumerable(reader.GetType())) | ||
{ | ||
_ = _sendIAsyncStreamItemsMethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long term, we should store the Takss returned by _sendIAsyncStreamItemsMethod and _sendStreamItemsMethod and track them during connection teardown and log warnings if they don't complete within a timeout.
src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs
Outdated
Show resolved
Hide resolved
⬆️ 📅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing needs to be fixed.
I wont make you do it in this PR, but we should consider refactoring this a little to avoid the captures in the local functions.
Hm there was a failure in one of the tests on the Mac Agent
This means that the stream type wasn't detected on the client side and there the invocation didn't register the streaming id with the server. |
The error seemed to be an issue with how the MessagePackHubProtocol was (or was not actually) handling StreamBindingFailureMessages. It was just throwing instead of sending the binding failure messages |
This comment was made automatically. If there is a problem contact ryanbrandenburg. I've triaged the above build. I've created/commented on the following issue(s) |
if (ReflectionHelper.IsIAsyncEnumerable(reader.GetType())) | ||
{ | ||
_ = _sendIAsyncStreamItemsMethod | ||
.MakeGenericMethod(reader.GetType().GetInterface("IAsyncEnumerable`1").GetGenericArguments()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikaelm12 is this right?
var connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory); | ||
try | ||
{ | ||
async IAsyncEnumerable<string> clientStreamData() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dude, casing, 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the case settled on local functions? I could see the argument for using camelCase like you would for anything else with a local scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it settled it’s always pascal case because this is c# not java or JavaScript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅
Not ready for review. Just hacking something that works together.Time for some eyes on this. Got rid of a lot of similar code.We're essentially adding checks for an
IAsyncEnumerable
type in the invocation params, associated themwith a stream id similarly to how we do with channels, then consume items from the stream and send them asStreamItem
messages.