aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/Calls.cs
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2015-08-10 22:51:29 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2015-08-10 22:51:29 -0700
commit1b926ee4ddde9b13c4f1b8a2e1c4d6684ea4c1fe (patch)
treec487014d1d4c64b5615bfc4c70ca6bb123a0fe64 /src/csharp/Grpc.Core/Calls.cs
parent9698b5b29f84707ca590c2f618c8f5d00a921da7 (diff)
add comments
Diffstat (limited to 'src/csharp/Grpc.Core/Calls.cs')
-rw-r--r--src/csharp/Grpc.Core/Calls.cs44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/csharp/Grpc.Core/Calls.cs b/src/csharp/Grpc.Core/Calls.cs
index b9128c914d..7067456638 100644
--- a/src/csharp/Grpc.Core/Calls.cs
+++ b/src/csharp/Grpc.Core/Calls.cs
@@ -38,9 +38,20 @@ namespace Grpc.Core
{
/// <summary>
/// Helper methods for generated clients to make RPC calls.
+ /// Most users will use this class only indirectly and will be
+ /// making calls using client object generated from protocol
+ /// buffer definition files.
/// </summary>
public static class Calls
{
+ /// <summary>
+ /// Invokes a simple remote call in a blocking fashion.
+ /// </summary>
+ /// <returns>The response.</returns>
+ /// <param name="call">The call defintion.</param>
+ /// <param name="req">Request message.</param>
+ /// <typeparam name="TRequest">Type of request message.</typeparam>
+ /// <typeparam name="TResponse">The of response message.</typeparam>
public static TResponse BlockingUnaryCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call, TRequest req)
where TRequest : class
where TResponse : class
@@ -49,6 +60,14 @@ namespace Grpc.Core
return asyncCall.UnaryCall(req);
}
+ /// <summary>
+ /// Invokes a simple remote call asynchronously.
+ /// </summary>
+ /// <returns>An awaitable call object providing access to the response.</returns>
+ /// <param name="call">The call defintion.</param>
+ /// <param name="req">Request message.</param>
+ /// <typeparam name="TRequest">Type of request message.</typeparam>
+ /// <typeparam name="TResponse">The of response message.</typeparam>
public static AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call, TRequest req)
where TRequest : class
where TResponse : class
@@ -58,6 +77,15 @@ namespace Grpc.Core
return new AsyncUnaryCall<TResponse>(asyncResult, asyncCall.GetStatus, asyncCall.GetTrailers, asyncCall.Cancel);
}
+ /// <summary>
+ /// Invokes a server streaming call asynchronously.
+ /// In server streaming scenario, client sends on request and server responds with a stream of responses.
+ /// </summary>
+ /// <returns>A call object providing access to the asynchronous response stream.</returns>
+ /// <param name="call">The call defintion.</param>
+ /// <param name="req">Request message.</param>
+ /// <typeparam name="TRequest">Type of request message.</typeparam>
+ /// <typeparam name="TResponse">The of response messages.</typeparam>
public static AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call, TRequest req)
where TRequest : class
where TResponse : class
@@ -68,6 +96,13 @@ namespace Grpc.Core
return new AsyncServerStreamingCall<TResponse>(responseStream, asyncCall.GetStatus, asyncCall.GetTrailers, asyncCall.Cancel);
}
+ /// <summary>
+ /// Invokes a client streaming call asynchronously.
+ /// In client streaming scenario, client sends a stream of requests and server responds with a single response.
+ /// </summary>
+ /// <returns>An awaitable call object providing access to the response.</returns>
+ /// <typeparam name="TRequest">Type of request messages.</typeparam>
+ /// <typeparam name="TResponse">The of response message.</typeparam>
public static AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call)
where TRequest : class
where TResponse : class
@@ -78,6 +113,15 @@ namespace Grpc.Core
return new AsyncClientStreamingCall<TRequest, TResponse>(requestStream, resultTask, asyncCall.GetStatus, asyncCall.GetTrailers, asyncCall.Cancel);
}
+ /// <summary>
+ /// Invokes a duplex streaming call asynchronously.
+ /// In duplex streaming scenario, client sends a stream of requests and server responds with a stream of responses.
+ /// The response stream is completely independent and both side can be sending messages at the same time.
+ /// </summary>
+ /// <returns>A call object providing access to the asynchronous request and response streams.</returns>
+ /// <param name="call">The call definition.</param>
+ /// <typeparam name="TRequest">Type of request messages.</typeparam>
+ /// <typeparam name="TResponse">Type of reponse messages.</typeparam>
public static AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call)
where TRequest : class
where TResponse : class