diff --git a/src/csharp/Grpc.Core/CallInvocationDetails.cs b/src/csharp/Grpc.Core/CallInvocationDetails.cs index 8959baf306b..6565073fc5e 100644 --- a/src/csharp/Grpc.Core/CallInvocationDetails.cs +++ b/src/csharp/Grpc.Core/CallInvocationDetails.cs @@ -49,16 +49,38 @@ namespace Grpc.Core readonly Marshaller responseMarshaller; CallOptions options; + /// + /// Initializes a new instance of the struct. + /// + /// Channel to use for this call. + /// Method to call. + /// Call options. public CallInvocationDetails(Channel channel, Method method, CallOptions options) : this(channel, method, null, options) { } + /// + /// Initializes a new instance of the struct. + /// + /// Channel to use for this call. + /// Method to call. + /// Host that contains the method. if null, default host will be used. + /// Call options. public CallInvocationDetails(Channel channel, Method method, string host, CallOptions options) : this(channel, method.FullName, host, method.RequestMarshaller, method.ResponseMarshaller, options) { } + /// + /// Initializes a new instance of the struct. + /// + /// Channel to use for this call. + /// Qualified method name. + /// Host that contains the method. + /// Request marshaller. + /// Response marshaller. + /// Call options. public CallInvocationDetails(Channel channel, string method, string host, Marshaller requestMarshaller, Marshaller responseMarshaller, CallOptions options) { this.channel = Preconditions.CheckNotNull(channel, "channel"); @@ -69,6 +91,9 @@ namespace Grpc.Core this.options = options; } + /// + /// Get channel associated with this call. + /// public Channel Channel { get @@ -77,6 +102,9 @@ namespace Grpc.Core } } + /// + /// Gets name of method to be called. + /// public string Method { get @@ -85,6 +113,9 @@ namespace Grpc.Core } } + /// + /// Get name of host. + /// public string Host { get @@ -93,6 +124,9 @@ namespace Grpc.Core } } + /// + /// Gets marshaller used to serialize requests. + /// public Marshaller RequestMarshaller { get @@ -101,6 +135,9 @@ namespace Grpc.Core } } + /// + /// Gets marshaller used to deserialized responses. + /// public Marshaller ResponseMarshaller { get @@ -109,6 +146,9 @@ namespace Grpc.Core } } + /// + /// Gets the call options. + /// public CallOptions Options { get diff --git a/src/csharp/Grpc.Core/Calls.cs b/src/csharp/Grpc.Core/Calls.cs index b9128c914d5..7067456638a 100644 --- a/src/csharp/Grpc.Core/Calls.cs +++ b/src/csharp/Grpc.Core/Calls.cs @@ -38,9 +38,20 @@ namespace Grpc.Core { /// /// 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. /// public static class Calls { + /// + /// Invokes a simple remote call in a blocking fashion. + /// + /// The response. + /// The call defintion. + /// Request message. + /// Type of request message. + /// The of response message. public static TResponse BlockingUnaryCall(CallInvocationDetails call, TRequest req) where TRequest : class where TResponse : class @@ -49,6 +60,14 @@ namespace Grpc.Core return asyncCall.UnaryCall(req); } + /// + /// Invokes a simple remote call asynchronously. + /// + /// An awaitable call object providing access to the response. + /// The call defintion. + /// Request message. + /// Type of request message. + /// The of response message. public static AsyncUnaryCall AsyncUnaryCall(CallInvocationDetails call, TRequest req) where TRequest : class where TResponse : class @@ -58,6 +77,15 @@ namespace Grpc.Core return new AsyncUnaryCall(asyncResult, asyncCall.GetStatus, asyncCall.GetTrailers, asyncCall.Cancel); } + /// + /// Invokes a server streaming call asynchronously. + /// In server streaming scenario, client sends on request and server responds with a stream of responses. + /// + /// A call object providing access to the asynchronous response stream. + /// The call defintion. + /// Request message. + /// Type of request message. + /// The of response messages. public static AsyncServerStreamingCall AsyncServerStreamingCall(CallInvocationDetails call, TRequest req) where TRequest : class where TResponse : class @@ -68,6 +96,13 @@ namespace Grpc.Core return new AsyncServerStreamingCall(responseStream, asyncCall.GetStatus, asyncCall.GetTrailers, asyncCall.Cancel); } + /// + /// Invokes a client streaming call asynchronously. + /// In client streaming scenario, client sends a stream of requests and server responds with a single response. + /// + /// An awaitable call object providing access to the response. + /// Type of request messages. + /// The of response message. public static AsyncClientStreamingCall AsyncClientStreamingCall(CallInvocationDetails call) where TRequest : class where TResponse : class @@ -78,6 +113,15 @@ namespace Grpc.Core return new AsyncClientStreamingCall(requestStream, resultTask, asyncCall.GetStatus, asyncCall.GetTrailers, asyncCall.Cancel); } + /// + /// 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. + /// + /// A call object providing access to the asynchronous request and response streams. + /// The call definition. + /// Type of request messages. + /// Type of reponse messages. public static AsyncDuplexStreamingCall AsyncDuplexStreamingCall(CallInvocationDetails call) where TRequest : class where TResponse : class