question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SignalR streaming from server to specific client

See original GitHub issue

Is your feature request related to a problem? Please describe.

I have a use case when server initiates a workflow with the client. Conventional SignalR call gives ability to pick specific client during invocation (MyHub.Clients.Client("clientid").SendAsync), but streaming doesn’t (or it is not documented).

Describe the solution you’d like

To have ability to stream to a specific client.

Describe alternatives you’ve considered

I don’t see a workaround since my application is distributed and if I do not “set up” a stream to the client on the first call (e.g. do Client("clientid").SendAsync and then open stream from the client), the response might be routed to random application instance which is unacceptable.

Additional context

There is a ASP.NET Core application deployed to two regions - US and EU. It runs behind Traffic Manager and contains a SignalR hub and uses Azure SignalR Service (single US instance) as backplane for scaling purposes. The hub interacts with the client in synchronous way - calls value-returning method and waits until it returns. The locking mechanism is implemented on top of in-memory collection of tasks, and thus there are problems when server-to-client communication originates on one instance (say EU), but client-to-server “response” is returned to another (US) - first application instance is locked indefinitely, because it never receives the response for the request, and second instance does nothing because it cannot map the response to any previous request. I’ve tried brand new ServerStickyMode=Required mode for Azure SignalR, but it does not help since my client is permanently in US -> Connect is always hitting US application -> all responses are “stuck” to US instance as well. I suspect streaming can help me with this scenario.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
analogrelaycommented, Mar 18, 2020

Pre-planning notes: I don’t see us having the resources to look at this in 5.0. It needs spec changes, new protocol messages, versioning considerations, etc. and we’re tight on resources this release because of other projects.

1reaction
analogrelaycommented, Sep 25, 2019

We’ll queue this for some discussions in 5.0. No committments yet, but we’ll talk about options here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use streaming in ASP.NET Core SignalR
The SignalR Java client can call client-to-server streaming methods on hubs by passing in an Observable as an argument to send , invoke...
Read more >
SignalR streaming from server to client
I can't get my server to stream data to a client with SignalR. The stream only gets 1 value, 0 in this case,...
Read more >
Streaming in SignalR - Scientific Programmer
In this type of streaming, we open a stream from the client. The client will then carry on sending messages via the stream...
Read more >
Advanced realtime streaming with SignalR in .NET Core
Since ASP.NET Core 2.1, we can now use SignalR streaming which is a new feature that allows us to push data to or...
Read more >
Is it possible to push a streaming from server to client ...
One client sends streaming to server, and server forward the streaming to another client. Can I use Clients.Client(connectionId).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found