aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs
diff options
context:
space:
mode:
authorGravatar Hongyu Chen <hongyu@google.com>2015-08-25 14:44:15 -0700
committerGravatar Hongyu Chen <hongyu@google.com>2015-08-25 14:44:15 -0700
commit011ea49592e71e1db3ef43a094aa9b452ff21e67 (patch)
tree70017b24ed2d3736552025680d4a0f138adf456f /src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs
parenta96ce800a8df5c62ffd264317836ecf3433c4344 (diff)
parent1b481b64be43bd4c7655b25422344a17b2f198d9 (diff)
Merge remote-tracking branch 'upstream/master' into timespec
Diffstat (limited to 'src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs')
-rw-r--r--src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs b/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs
index 183c84216a..e75108c7e5 100644
--- a/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs
+++ b/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs
@@ -32,24 +32,29 @@
#endregion
using System;
+using System.Threading.Tasks;
namespace Grpc.Core
{
/// <summary>
/// Return type for bidirectional streaming calls.
/// </summary>
+ /// <typeparam name="TRequest">Request message type for this call.</typeparam>
+ /// <typeparam name="TResponse">Response message type for this call.</typeparam>
public sealed class AsyncDuplexStreamingCall<TRequest, TResponse> : IDisposable
{
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)
+ internal 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 +83,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>