9 instantiations of CompletionMessage
Microsoft.AspNetCore.Components.Server (1)
src\aspnetcore\src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
210return ApplyHeaders(headers, new CompletionMessage(invocationId, error, result, hasResult));
Microsoft.AspNetCore.SignalR.Common (3)
Protocol\CompletionMessage.cs (3)
66=> new CompletionMessage(invocationId, error, result: null, hasResult: false); 75=> new CompletionMessage(invocationId, error: null, result: payload, hasResult: true); 84=> new CompletionMessage(invocationId, error: null, result: null, hasResult: false);
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Protocol\JsonHubProtocol.cs (2)
752return new CompletionMessage(invocationId, error, result, hasResult: true); 755return new CompletionMessage(invocationId, error, result: null, hasResult: false);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Protocol\MessagePackHubProtocolWorker.cs (1)
210return ApplyHeaders(headers, new CompletionMessage(invocationId, error, result, hasResult));
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
Protocol\NewtonsoftJsonHubProtocol.cs (2)
745return new CompletionMessage(invocationId, error, result, hasResult: true); 748return new CompletionMessage(invocationId, error, result: null, hasResult: false);
80 references to CompletionMessage
Microsoft.AspNetCore.Components.Server (3)
src\aspnetcore\src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (3)
159private CompletionMessage CreateCompletionMessage(ref MessagePackReader reader, IInvocationBinder binder) 400case CompletionMessage completionMessage: 525private void WriteCompletionMessage(CompletionMessage message, ref MessagePackWriter writer)
Microsoft.AspNetCore.SignalR.Client.Core (11)
HubConnection.cs (8)
1004await SendHubMessage(connectionState, CompletionMessage.WithError(streamId, responseError), cancellationToken: default).ConfigureAwait(false); 1307await SendWithLock(connectionState, CompletionMessage.WithError(bindingFailure.InvocationId, "Client failed to parse argument(s)."), cancellationToken: default).ConfigureAwait(false); 1318case CompletionMessage completion: 1385await SendWithLock(connectionState, CompletionMessage.WithError(invocation.InvocationId!, "Client didn't provide a result."), cancellationToken: default).ConfigureAwait(false); 1435await SendWithLock(connectionState, CompletionMessage.WithError(invocation.InvocationId!, resultException.Message), cancellationToken: default).ConfigureAwait(false); 1439await SendWithLock(connectionState, CompletionMessage.WithResult(invocation.InvocationId!, result), cancellationToken: default).ConfigureAwait(false); 1444await SendWithLock(connectionState, CompletionMessage.WithError(invocation.InvocationId!, "Client didn't provide a result."), cancellationToken: default).ConfigureAwait(false); 1472private void DispatchInvocationCompletion(CompletionMessage completion, InvocationRequest irq)
Internal\InvocationRequest.cs (3)
64public abstract void Complete(CompletionMessage message); 90public override void Complete(CompletionMessage completionMessage) 178public override void Complete(CompletionMessage completionMessage)
Microsoft.AspNetCore.SignalR.Common (11)
Protocol\CompletionMessage.cs (10)
30/// Constructs a <see cref="CompletionMessage"/>. 60/// Constructs a <see cref="CompletionMessage"/> with an error. 64/// <returns>The constructed <see cref="CompletionMessage"/>.</returns> 65public static CompletionMessage WithError(string invocationId, string? error) 69/// Constructs a <see cref="CompletionMessage"/> with a result. 73/// <returns>The constructed <see cref="CompletionMessage"/>.</returns> 74public static CompletionMessage WithResult(string invocationId, object? payload) 78/// Constructs a <see cref="CompletionMessage"/> without an error or result. 82/// <returns>The constructed <see cref="CompletionMessage"/>.</returns> 83public static CompletionMessage Empty(string invocationId)
Protocol\RawResult.cs (1)
23/// Stores the raw serialized bytes of a <see cref="CompletionMessage.Result"/> for forwarding to another server.
Microsoft.AspNetCore.SignalR.Core (21)
DefaultHubLifetimeManager.cs (1)
384public override Task SetConnectionResultAsync(string connectionId, CompletionMessage result)
HubLifetimeManager.cs (1)
158public virtual Task SetConnectionResultAsync(string connectionId, CompletionMessage result)
Internal\DefaultHubDispatcher.cs (10)
205case CompletionMessage completionMessage: 260var message = CompletionMessage.WithError(bindingFailureMessage.Id, errorString); 292return connection.WriteAsync(CompletionMessage.WithError( 445await connection.WriteAsync(CompletionMessage.WithResult(hubMethodInvocationMessage.InvocationId, result)); 499connection.StreamTracker.TryComplete(CompletionMessage.Empty(stream)); 602await connection.WriteAsync(CompletionMessage.WithError(invocationId, error)); 655await connection.WriteAsync(CompletionMessage.WithError(invocationId, errorMessage)); 699await connection.WriteAsync(CompletionMessage.WithError(hubMethodInvocationMessage.InvocationId, 709await connection.WriteAsync(CompletionMessage.WithError(hubMethodInvocationMessage.InvocationId!,
Internal\DefaultHubDispatcherLog.cs (2)
83public static void CompletingStream(ILogger logger, CompletionMessage message) 89public static void ClosingStreamWithBindingError(ILogger logger, CompletionMessage message)
src\aspnetcore\src\SignalR\common\Shared\ClientResultsManager.cs (6)
16private readonly ConcurrentDictionary<string, (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Complete)> _pendingInvocations = new(); 41public void AddInvocation(string invocationId, (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Complete) invocationInfo) 48invocationInfo.Complete(invocationInfo.Tcs, CompletionMessage.WithError(invocationId, "ID collision occurred when using client results. This is likely a bug in SignalR.")); 52public void TryCompleteResult(string connectionId, CompletionMessage message) 75public (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Completion)? RemoveInvocation(string invocationId) 152_clientResultsManager.TryCompleteResult(_connectionId, CompletionMessage.WithError(_invocationId, "Invocation canceled by the server."));
StreamTracker.cs (1)
74public bool TryComplete(CompletionMessage message)
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Protocol\JsonHubProtocol.cs (2)
541case CompletionMessage m: 592private void WriteCompletionMessage(CompletionMessage message, Utf8JsonWriter writer)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (3)
Protocol\MessagePackHubProtocolWorker.cs (3)
159private CompletionMessage CreateCompletionMessage(ref MessagePackReader reader, IInvocationBinder binder) 400case CompletionMessage completionMessage: 525private void WriteCompletionMessage(CompletionMessage message, ref MessagePackWriter writer)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
Protocol\NewtonsoftJsonHubProtocol.cs (2)
538case CompletionMessage m: 591private void WriteCompletionMessage(CompletionMessage message, JsonTextWriter writer)
Microsoft.AspNetCore.SignalR.Specification.Tests (15)
HubLifetimeManagerTestBase.cs (7)
194await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, 10)).DefaultTimeout(); 221await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithError(invocation.InvocationId, "Error from client")).DefaultTimeout(); 252manager.SetConnectionResultAsync(connection2.ConnectionId, CompletionMessage.WithError(invocation.InvocationId, "Error from client"))).DefaultTimeout(); 257await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, 10)).DefaultTimeout(); 307await manager1.SetConnectionResultAsync(connection2.ConnectionId, CompletionMessage.WithError(invocation2.InvocationId, "error")); 312await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation1.InvocationId, 3)); 365await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation1.InvocationId, 1));
ScaleoutHubLifetimeManagerTests.cs (5)
491await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, 10)).DefaultTimeout(); 522await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithError(invocation.InvocationId, "Error from client")).DefaultTimeout(); 605await manager1.SetConnectionResultAsync(connection.ConnectionId, CompletionMessage.WithResult(invocation2.InvocationId, 2)).DefaultTimeout(); 606await manager2.SetConnectionResultAsync(connection.ConnectionId, CompletionMessage.WithResult(invocation1.InvocationId, 5)).DefaultTimeout(); 654await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, "wrong type")).DefaultTimeout();
src\aspnetcore\src\SignalR\common\testassets\Tests.Utils\TestClient.cs (3)
139case CompletionMessage _: 149public async Task<CompletionMessage> InvokeAsync(string methodName, params object[] args) 171case CompletionMessage completion:
Microsoft.AspNetCore.SignalR.StackExchangeRedis (12)
RedisHubLifetimeManager.cs (6)
437public override Task SetConnectionResultAsync(string connectionId, CompletionMessage result) 573invocationInfo?.Completion(null!, CompletionMessage.WithError(invocation.InvocationId, "Connection disconnected.")); 701var invocationInfo = _clientResultsManager.RemoveInvocation(((CompletionMessage)hubMessage!).InvocationId!); 705hubMessage = CompletionMessage.WithError(((CompletionMessage)hubMessage!).InvocationId!, $"Client result wasn't deserializable to {invocationInfo?.Type.Name}."); 708invocationInfo?.Completion(invocationInfo?.Tcs!, (CompletionMessage)hubMessage!);
src\aspnetcore\src\SignalR\common\Shared\ClientResultsManager.cs (6)
16private readonly ConcurrentDictionary<string, (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Complete)> _pendingInvocations = new(); 41public void AddInvocation(string invocationId, (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Complete) invocationInfo) 48invocationInfo.Complete(invocationInfo.Tcs, CompletionMessage.WithError(invocationId, "ID collision occurred when using client results. This is likely a bug in SignalR.")); 52public void TryCompleteResult(string connectionId, CompletionMessage message) 75public (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Completion)? RemoveInvocation(string invocationId) 152_clientResultsManager.TryCompleteResult(_connectionId, CompletionMessage.WithError(_invocationId, "Invocation canceled by the server."));