From 4d7f40854fc55319b29eceed8f9b95f752d43284 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Fri, 6 Oct 2017 14:51:11 -0700 Subject: [PATCH] Make constructors for `Async*Call` objects public --- src/csharp/Grpc.Core/AsyncClientStreamingCall.cs | 16 +++++++++++++++- src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs | 16 +++++++++++++++- src/csharp/Grpc.Core/AsyncServerStreamingCall.cs | 14 +++++++++++++- src/csharp/Grpc.Core/AsyncUnaryCall.cs | 15 ++++++++++++++- 4 files changed, 57 insertions(+), 4 deletions(-) diff --git a/src/csharp/Grpc.Core/AsyncClientStreamingCall.cs b/src/csharp/Grpc.Core/AsyncClientStreamingCall.cs index 087b6859639..f59989655ec 100644 --- a/src/csharp/Grpc.Core/AsyncClientStreamingCall.cs +++ b/src/csharp/Grpc.Core/AsyncClientStreamingCall.cs @@ -36,7 +36,21 @@ namespace Grpc.Core readonly Func getTrailersFunc; readonly Action disposeAction; - internal AsyncClientStreamingCall(IClientStreamWriter requestStream, Task responseAsync, Task responseHeadersAsync, Func getStatusFunc, Func getTrailersFunc, Action disposeAction) + /// + /// Creates a new AsyncClientStreamingCall object with the specified properties. + /// + /// Stream of request values. + /// The response of the asynchronous call. + /// Response headers of the asynchronous call. + /// Delegate returning the status of the call. + /// Delegate returning the trailing metadata of the call. + /// Delegate to invoke when Dispose is called on the call object. + public AsyncClientStreamingCall(IClientStreamWriter requestStream, + Task responseAsync, + Task responseHeadersAsync, + Func getStatusFunc, + Func getTrailersFunc, + Action disposeAction) { this.requestStream = requestStream; this.responseAsync = responseAsync; diff --git a/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs b/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs index ce49fb1596d..1cb1a918595 100644 --- a/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs +++ b/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs @@ -35,7 +35,21 @@ namespace Grpc.Core readonly Func getTrailersFunc; readonly Action disposeAction; - internal AsyncDuplexStreamingCall(IClientStreamWriter requestStream, IAsyncStreamReader responseStream, Task responseHeadersAsync, Func getStatusFunc, Func getTrailersFunc, Action disposeAction) + /// + /// Creates a new AsyncDuplexStreamingCall object with the specified properties. + /// + /// Stream of request values. + /// Stream of response values. + /// Response headers of the asynchronous call. + /// Delegate returning the status of the call. + /// Delegate returning the trailing metadata of the call. + /// Delegate to invoke when Dispose is called on the call object. + public AsyncDuplexStreamingCall(IClientStreamWriter requestStream, + IAsyncStreamReader responseStream, + Task responseHeadersAsync, + Func getStatusFunc, + Func getTrailersFunc, + Action disposeAction) { this.requestStream = requestStream; this.responseStream = responseStream; diff --git a/src/csharp/Grpc.Core/AsyncServerStreamingCall.cs b/src/csharp/Grpc.Core/AsyncServerStreamingCall.cs index fbc97b81481..4303b0b1b02 100644 --- a/src/csharp/Grpc.Core/AsyncServerStreamingCall.cs +++ b/src/csharp/Grpc.Core/AsyncServerStreamingCall.cs @@ -33,7 +33,19 @@ namespace Grpc.Core readonly Func getTrailersFunc; readonly Action disposeAction; - internal AsyncServerStreamingCall(IAsyncStreamReader responseStream, Task responseHeadersAsync, Func getStatusFunc, Func getTrailersFunc, Action disposeAction) + /// + /// Creates a new AsyncDuplexStreamingCall object with the specified properties. + /// + /// Stream of response values. + /// Response headers of the asynchronous call. + /// Delegate returning the status of the call. + /// Delegate returning the trailing metadata of the call. + /// Delegate to invoke when Dispose is called on the call object. + public AsyncServerStreamingCall(IAsyncStreamReader responseStream, + Task responseHeadersAsync, + Func getStatusFunc, + Func getTrailersFunc, + Action disposeAction) { this.responseStream = responseStream; this.responseHeadersAsync = responseHeadersAsync; diff --git a/src/csharp/Grpc.Core/AsyncUnaryCall.cs b/src/csharp/Grpc.Core/AsyncUnaryCall.cs index 6348f3c5fd4..17747f86caa 100644 --- a/src/csharp/Grpc.Core/AsyncUnaryCall.cs +++ b/src/csharp/Grpc.Core/AsyncUnaryCall.cs @@ -34,7 +34,20 @@ namespace Grpc.Core readonly Func getTrailersFunc; readonly Action disposeAction; - internal AsyncUnaryCall(Task responseAsync, Task responseHeadersAsync, Func getStatusFunc, Func getTrailersFunc, Action disposeAction) + + /// + /// Creates a new AsyncUnaryCall object with the specified properties. + /// + /// The response of the asynchronous call. + /// Response headers of the asynchronous call. + /// Delegate returning the status of the call. + /// Delegate returning the trailing metadata of the call. + /// Delegate to invoke when Dispose is called on the call object. + public AsyncUnaryCall(Task responseAsync, + Task responseHeadersAsync, + Func getStatusFunc, + Func getTrailersFunc, + Action disposeAction) { this.responseAsync = responseAsync; this.responseHeadersAsync = responseHeadersAsync;