public override AsyncUnaryCall <TResponse> AsyncUnaryCall <TRequest, TResponse>( TRequest request, ClientInterceptorContext <TRequest, TResponse> context, Interceptor.AsyncUnaryCallContinuation <TRequest, TResponse> continuation) { var token = _httpContextAccesor.HttpContext.Request.Headers["Authorization"]; var headers = new Metadata { { "Authorization", token } }; var options = context.Options.WithHeaders(headers); context = new ClientInterceptorContext <TRequest, TResponse>(context.Method, context.Host, options); return(base.AsyncUnaryCall(request, context, continuation)); }
public AsyncUnaryCall <TResponse> AsyncUnaryCall(TRequest request, Interceptor.AsyncUnaryCallContinuation <TRequest, TResponse> continuation) { _tracer.Request(request, _context); var rspCnt = continuation(request, _context); var rspAsync = rspCnt.ResponseAsync.ContinueWith(rspTask => { try { var response = rspTask.Result; _tracer.Response(response, _context); _tracer.Finish(_context); return(response); } catch (AggregateException ex) { _tracer.Exception(_context, ex.InnerException, request); throw ex.InnerException; } }); return(new AsyncUnaryCall <TResponse>(rspAsync, rspCnt.ResponseHeadersAsync, rspCnt.GetStatus, rspCnt.GetTrailers, rspCnt.Dispose)); }
public override AsyncUnaryCall <TResponse> AsyncUnaryCall <TRequest, TResponse>(TRequest request, ClientInterceptorContext <TRequest, TResponse> context, Interceptor.AsyncUnaryCallContinuation <TRequest, TResponse> continuation) { return(continuation(request, context)); }
public override AsyncUnaryCall <TResponse> AsyncUnaryCall <TRequest, TResponse>(TRequest request, ClientInterceptorContext <TRequest, TResponse> context, Interceptor.AsyncUnaryCallContinuation <TRequest, TResponse> continuation) { var callOptions = SetDeadline(context.Options); var newContext = new ClientInterceptorContext <TRequest, TResponse>(context.Method, context.Host, callOptions); return(continuation(request, context)); }