From 43fc0854c38bbde1cb495d1b5e4f3e594da79e50 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Mon, 23 Apr 2018 15:25:57 -0700 Subject: [PATCH] Remove unnecessary hop (#2136) --- src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs b/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs index bc7016e8a6..2d19c67a36 100644 --- a/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs +++ b/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs @@ -86,6 +86,7 @@ namespace Microsoft.AspNetCore.SignalR.Client } } + // If the registered callback blocks it can cause the client to stop receiving messages. If you need to block, get off the current thread first. public IDisposable On(string methodName, Type[] parameterTypes, Func handler, object state) { Log.RegisteringHandler(_logger, methodName); @@ -443,9 +444,6 @@ namespace Microsoft.AspNetCore.SignalR.Client private async Task DispatchInvocationAsync(InvocationMessage invocation) { - // Make sure we get off the main event loop before we dispatch into user code - await AwaitableThreadPool.Yield(); - // Find the handler if (!_handlers.TryGetValue(invocation.Target, out var invocationHandlerList)) {