2

We are using signal r to fetch data for 20 tiles.

We call FetchData() on all 20 tiles at the same time, it then fires of a message on signal r to request that data. (each tile has subscribed to get the answers)

We find that each tile will populate its data one at a time, as if the signal r only fetches the next tiles response after the first tile has been completed?

I know this is super high level, but in my mind, it worked like an AJAX request. Where if I fired off 20 requests in a row, they would all randomly return out of order?

Tiny Wang
  • 10,423
  • 1
  • 11
  • 29
Zapnologica
  • 22,170
  • 44
  • 158
  • 253
  • signalr worked by connecting clients with server with connection-id, you wanna a client message to broadcast to all clients, then message will be sent to all clients, if wanna the message to be sent to a specific user, then it will be only sent to that user. If your scenario is that only one client and send multiple messages to server and this client will also prepare to receive response, then [this answer](https://stackoverflow.com/questions/22197129/how-to-do-guaranteed-message-delivery-with-signalr) may help you I think.... – Tiny Wang May 23 '22 at 07:45

1 Answers1

1

By default, SignalR only allows a single execution from a client at a time. So if you fire of 20 concurrent calls to invoke a hub method, it'll run those in sequence (there are exceptions to this rule but that's the idea). This article talks about some of the configuration https://learn.microsoft.com/en-us/aspnet/core/signalr/configuration?view=aspnetcore-6.0&tabs=dotnet#configure-server-options. You'd want to increase MaximumParallelInvocationsPerClient so something other than 1.

davidfowl
  • 37,120
  • 7
  • 93
  • 103