diff options
author | Craig Tiller <ctiller@google.com> | 2015-08-24 14:32:54 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-08-24 14:32:54 -0700 |
commit | 11c3c68f9d72d3f7d410b660dd4dc134762f70fa (patch) | |
tree | 558c2cfbf1b88c504cad0e7c6f2e1f1d001eaf6f /src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs | |
parent | 7f4fc98704fa5130f4919139427338ca6b309a52 (diff) | |
parent | ddb0b8c4956b986a26cbbcabd4c4d81b9391770d (diff) |
Merge github.com:grpc/grpc into endpoints
Diffstat (limited to 'src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs')
-rw-r--r-- | src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs b/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs index 0979de606f..ee7ba29695 100644 --- a/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs +++ b/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs @@ -32,7 +32,6 @@ #endregion using System; -using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace Grpc.Core @@ -44,14 +43,16 @@ namespace Grpc.Core { readonly IClientStreamWriter<TRequest> requestStream; readonly IAsyncStreamReader<TResponse> responseStream; + readonly Task<Metadata> responseHeadersAsync; readonly Func<Status> getStatusFunc; readonly Func<Metadata> getTrailersFunc; readonly Action disposeAction; - public AsyncDuplexStreamingCall(IClientStreamWriter<TRequest> requestStream, IAsyncStreamReader<TResponse> responseStream, Func<Status> getStatusFunc, Func<Metadata> getTrailersFunc, Action disposeAction) + public AsyncDuplexStreamingCall(IClientStreamWriter<TRequest> requestStream, IAsyncStreamReader<TResponse> responseStream, Task<Metadata> responseHeadersAsync, Func<Status> getStatusFunc, Func<Metadata> getTrailersFunc, Action disposeAction) { this.requestStream = requestStream; this.responseStream = responseStream; + this.responseHeadersAsync = responseHeadersAsync; this.getStatusFunc = getStatusFunc; this.getTrailersFunc = getTrailersFunc; this.disposeAction = disposeAction; @@ -80,6 +81,17 @@ namespace Grpc.Core } /// <summary> + /// Asynchronous access to response headers. + /// </summary> + public Task<Metadata> ResponseHeadersAsync + { + get + { + return this.responseHeadersAsync; + } + } + + /// <summary> /// Gets the call status if the call has already finished. /// Throws InvalidOperationException otherwise. /// </summary> |