Task WriteResponse(TResponse response, ReverseCallId callId, CancellationToken cancellationToken) { var responseContext = new ReverseCallResponseContext { CallId = callId.ToProtobuf() }; _setResponseContext(response, responseContext); var message = new TClientMessage(); _setMessageResponse(message, response); if (!cancellationToken.IsCancellationRequested) { _logger.Trace("Writing response for request '{CallId}'", callId); return(_clientToServer.WriteAsync(message)); } _logger.Debug("Reverse Call Client was cancelled before response could be written for request '{CallId}'", callId); return(Task.CompletedTask); }
internal static void WritingRequest(this ILogger logger, ReverseCallId callId) => _writingRequest(logger, callId, null);
internal static void HandlingRequestFailedToWriteResponse(this ILogger logger, Type requestType, ReverseCallId callId, Exception exception) => _handlingRequestFailedToWriteResponse(logger, requestType, callId, exception);
internal static void HandlingRequestFailedToInvokeCallback(this ILogger logger, Type requestType, ReverseCallId callId, Exception exception) => _handlingRequestFailedToInvokeCallback(logger, requestType, callId, exception);
internal static void HandledRequest(this ILogger logger, Type requestType, ReverseCallId callId, TimeSpan handleTime) => _handledRequest(logger, requestType, callId, handleTime, null);
internal static void HandlingRequest(this ILogger logger, Type requestType, ReverseCallId callId) => _handlingRequest(logger, requestType, callId, null);