Plugins\IMessageDispatcher.cs (6)
33Message CreateMessage(MessageType type, MessageMethod method);
43Message CreateMessage<TPayload>(MessageType type, MessageMethod method, TPayload payload)
52Task DispatchCancelAsync(Message request, CancellationToken cancellationToken);
61Task DispatchFaultAsync(Message request, Fault fault, CancellationToken cancellationToken);
70Task DispatchProgressAsync(Message request, Progress progress, CancellationToken cancellationToken);
98Task DispatchResponseAsync<TOutbound>(Message request, TOutbound responsePayload, CancellationToken cancellationToken)
Plugins\MessageConverter.cs (13)
12internal sealed class MessageConverter : JsonConverter<Message>
103public override Message Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
108if (!root.TryGetProperty(nameof(Message.RequestId), out var requestIdProp))
110throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.RequestId)));
116throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentCannotBeNullOrEmpty, nameof(Message.RequestId)));
119if (!root.TryGetProperty(nameof(Message.Type), out var typeProp))
121throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.Type)));
130if (!root.TryGetProperty(nameof(Message.Method), out var methodProp))
132throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.Method)));
170public override void Write(Utf8JsonWriter writer, Message value, JsonSerializerOptions options)
173writer.WriteString(nameof(Message.RequestId), value.RequestId);
174writer.WriteString(nameof(Message.Type), value.Type.ToString());
175writer.WriteString(nameof(Message.Method), value.Method.ToString());
Plugins\MessageDispatcher.cs (22)
143public Message CreateMessage(MessageType type, MessageMethod method)
159public Message CreateMessage<TPayload>(MessageType type, MessageMethod method, TPayload payload)
181public Task DispatchCancelAsync(Message request, CancellationToken cancellationToken)
211public Task DispatchFaultAsync(Message request, Fault fault, CancellationToken cancellationToken)
242public Task DispatchProgressAsync(Message request, Progress progress, CancellationToken cancellationToken)
318Message request,
371Message request,
381Message request,
391var message = MessageUtilities.Create(request.RequestId, type, request.Method, payload);
405Message request,
408var message = MessageUtilities.Create(request.RequestId, MessageType.Cancel, request.Method);
415Message request,
419Message message;
439Message request,
443var message = MessageUtilities.Create(request.RequestId, MessageType.Progress, request.Method, progress);
450Message response,
467var message = CreateMessage(type, method, payload);
588private void HandleInboundCancel(Message message)
600private void HandleInboundFault(Message fault)
612private void HandleInboundRequest(Message message)
681Message message,
693Message message,