Remove unnecessary hop (#2136)

This commit is contained in:
BrennanConroy 2018-04-23 15:25:57 -07:00 committed by GitHub
parent bd46d757ba
commit 43fc0854c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -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<object[], object, Task> 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))
{