SignalR Server to Client call in parallel (c#)

764 Views Asked by At

I'm working on a SignalR scenario where the server needs to call clients methods in parallel.

In my tests, the calls to the same client seem sequentials.

I've seen, with the .Net5 was added a new property on the server, MaximumParallelInvocationsPerClient but this property seems to work only on the client to server calls.

There is any option to call client methods in parallel?

Edit: Testing with net core 2.1 on the c# client I Saw the calls to the client are sended in parallel, for this reason, the problem isn't on the server but it is on the client.

Thanks,

1

There are 1 best solutions below

2
On

Since I can't find any property to indicate to process requests in parallel, the best option is run the action as a task without await:

con.On("ClientCommandName", () =>
        {
            Task.Run(() =>
            {
                //Code of the action....
            });
        });