aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2015-08-21 16:07:57 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2015-08-21 16:13:57 -0700
commit4c25efa5195a81141ec1fc1dfa9dca42a74d377a (patch)
treed1140a97bf2af639462a1f3f8145acc06c89fd4d /src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs
parent3af838a2d719c65c360f28ee8551c6012f408401 (diff)
support for reading response headers on client side
Diffstat (limited to 'src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs')
-rw-r--r--src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs b/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs
index 183c84216a..ee7ba29695 100644
--- a/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs
+++ b/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs
@@ -32,6 +32,7 @@
#endregion
using System;
+using System.Threading.Tasks;
namespace Grpc.Core
{
@@ -42,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;
@@ -78,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>