-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Non-serialized hub invocations #5351
Comments
We can revisit this in 3.0. We intentionally disabled concurrent invocations because there was some concern around memory issues. We lifted the restriction for streaming invocations because they don't make sense with that restriction. We can revisit this though in 3.0 |
For design: Here is a short conversation about making the invocations serial aspnet/SignalR#2086 (comment) |
Let's talk about a design for this in preview 4 (implementation may wait). We probably need this to be opt-in behavior to reduce the risk of user async code going haywire. |
Sounds like this may be important for Razor Components (cc @SteveSandersonMS @davidfowl @rynowak @javiercn) |
@anurse It's not required for Razor Components, because Razor Components has its own sync context anyway. As far as SignalR is concerned, all the calls into |
We should do this regardless. |
@davidfowl I don't disagree, it just doesn't align with any of our epics so the prioritization is a little different. If Razor Components had required it, that would have changed the prioritization. |
@anurse Where is the "we have bugs" epic? |
Are there any updates on this? I think in regard to long running server methods this can be considered a blocker like stated in #10257 (Client timeout..). The suggested workarounds are not really helpfull neither. And it has been moved around for quite some time. Waiting on this issue to be resolved my workaround was to increase the |
It's in the 5.0 milestone. We'll look at it then. |
While I agree it would be better to allow non-serialized hub invocations for all invocation types, streaming invocations do allow for parallel hub method calls from a single client. Why is this workaround not helpful @ddweber? |
For development that is ok but once deployed in production that is really a breaking change.. |
@ddweber The doc link you posted is for version 2.2 of the Java client. In 3.0, the Java client does support server-to-client streaming which is all that's necessary for non-serialized hub invocations. |
I'd also suggest looking at our top-level client features matrix: https://docs.microsoft.com/en-us/aspnet/core/signalr/client-features?view=aspnetcore-3.0 it's a good way to view the supported features and which versions support them. |
Oh my fault, sorry. I did not notice that my bookmark pointed to a fixed older version :( |
I have tried to circumvent the missing stream invocations in the Java client by introducing for each streaming method on my Hub a sibling method that would
await
and return the next value that a ChannelReader would provide. The client would then have to immediately invoke the same method again after receiving a value to simulate continuous values. In my C# design validation client, I try to invoke two methods, runTask.WhenAny
and then re-issue the finished invocation.However, the invocation serialization from 1957655 means that any additional incoming message on the connection will only be dispatched when a running (async-blocking) invocation has finished. This includes any second invocation, a new streaming invocation and (which is where it's likely getting interesting) any form of graceful connection abort from the client. As far as I could see in the code for the latter case, all forms of
Abort
(which would trigger the cancellation token) originate from outside the dispatch loop, so only actually reading from the input pipe can close a connection which is blocked by the running invocation.So: Personally, I'd love to see lifting the restriction around non-streaming invocations...
The text was updated successfully, but these errors were encountered: