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);
        }
Exemple #2
0
 public void SetResponseContext(ReverseCallResponseContext context, MyResponse response)
 => response.Context = context;
 /// <inheritdoc/>
 public void SetResponseContext(ReverseCallResponseContext context, ConsumerResponse response)
 => response.CallContext = context;