public override AsyncDuplexStreamingCall <TRequest, TResponse> AsyncDuplexStreamingCall <TRequest, TResponse>(Method <TRequest, TResponse> method, string host, CallOptions options)
        {
            var _context              = new ClientInterceptorContext <TRequest, TResponse>(method, host, options);
            var rspCnt                = Calls.AsyncDuplexStreamingCall(CreateCall(method, host, options));
            var tracingRequestStream  = new TracingClientStreamWriter <TRequest, TResponse>(rspCnt.RequestStream, _context, _tracer.Request);
            var tracingResponseStream = new TracingAsyncClientStreamReader <TResponse, TRequest>(rspCnt.ResponseStream, _context, _tracer.Response, _tracer.Finish, _tracer.Exception);

            return(new AsyncDuplexStreamingCall <TRequest, TResponse>(tracingRequestStream, tracingResponseStream, rspCnt.ResponseHeadersAsync, rspCnt.GetStatus, rspCnt.GetTrailers, rspCnt.Dispose));
        }
Пример #2
0
        public override AsyncServerStreamingCall <TResponse> AsyncServerStreamingCall <TRequest, TResponse>(Method <TRequest, TResponse> method, string host, CallOptions options, TRequest request)
        {
            options = options.Headers == null?options.WithHeaders(new Metadata()) : options;

            var _context = new ClientInterceptorContext <TRequest, TResponse>(method, host, options);

            _tracer.Request(request, _context);
            var rspCnt = Calls.AsyncServerStreamingCall(CreateCall(method, host, options), request);
            var tracingResponseStream = new TracingAsyncClientStreamReader <TResponse, TRequest>(rspCnt.ResponseStream, _context, _tracer.Response, _tracer.Finish, _tracer.Exception);

            return(new AsyncServerStreamingCall <TResponse>(tracingResponseStream, rspCnt.ResponseHeadersAsync, rspCnt.GetStatus, rspCnt.GetTrailers, rspCnt.Dispose));
        }