/// <inheritdoc/> public override async Task ServerStreamingServerHandler <TRequest, TResponse>( TRequest request, IServerStreamWriter <TResponse> responseStream, ServerCallContext context, ServerStreamingServerMethod <TRequest, TResponse> continuation) { using var rpcScope = new ServerRpcScope <TRequest, TResponse>(context, this.options); try { rpcScope.RecordRequest(request); var responseStreamProxy = new ServerStreamWriterProxy <TResponse>( responseStream, rpcScope.RecordResponse); await continuation(request, responseStreamProxy, context).ConfigureAwait(false); rpcScope.Complete(); } catch (Exception e) { rpcScope.CompleteWithException(e); throw; } }
/// <inheritdoc/> public override async Task <TResponse> UnaryServerHandler <TRequest, TResponse>( TRequest request, ServerCallContext context, UnaryServerMethod <TRequest, TResponse> continuation) { using var rpcScope = new ServerRpcScope <TRequest, TResponse>(context, this.options); try { rpcScope.RecordRequest(request); var response = await continuation(request, context).ConfigureAwait(false); rpcScope.RecordResponse(response); rpcScope.Complete(); return(response); } catch (Exception e) { rpcScope.CompleteWithException(e); throw; } }