Show / Hide Table of Contents

Class Calls

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.

Inheritance
System.Object
Calls
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Grpc.Core
Assembly: Grpc.Core.dll
Syntax
public static class Calls

Methods

AsyncClientStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse>)

Invokes a client streaming call asynchronously. In client streaming scenario, client sends a stream of requests and server responds with a single response.

Declaration
public static AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call)
    where TRequest : class where TResponse : class
Parameters
Type Name Description
CallInvocationDetails<TRequest, TResponse> call

The call defintion.

Returns
Type Description
AsyncClientStreamingCall<TRequest, TResponse>

An awaitable call object providing access to the response.

Type Parameters
Name Description
TRequest

Type of request messages.

TResponse

The of response message.

AsyncDuplexStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse>)

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.

Declaration
public static AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call)
    where TRequest : class where TResponse : class
Parameters
Type Name Description
CallInvocationDetails<TRequest, TResponse> call

The call definition.

Returns
Type Description
AsyncDuplexStreamingCall<TRequest, TResponse>

A call object providing access to the asynchronous request and response streams.

Type Parameters
Name Description
TRequest

Type of request messages.

TResponse

Type of reponse messages.

AsyncServerStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse>, TRequest)

Invokes a server streaming call asynchronously. In server streaming scenario, client sends on request and server responds with a stream of responses.

Declaration
public static AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call, TRequest req)
    where TRequest : class where TResponse : class
Parameters
Type Name Description
CallInvocationDetails<TRequest, TResponse> call

The call defintion.

TRequest req

Request message.

Returns
Type Description
AsyncServerStreamingCall<TResponse>

A call object providing access to the asynchronous response stream.

Type Parameters
Name Description
TRequest

Type of request message.

TResponse

The of response messages.

AsyncUnaryCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse>, TRequest)

Invokes a simple remote call asynchronously.

Declaration
public static AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call, TRequest req)
    where TRequest : class where TResponse : class
Parameters
Type Name Description
CallInvocationDetails<TRequest, TResponse> call

The call defintion.

TRequest req

Request message.

Returns
Type Description
AsyncUnaryCall<TResponse>

An awaitable call object providing access to the response.

Type Parameters
Name Description
TRequest

Type of request message.

TResponse

The of response message.

BlockingUnaryCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse>, TRequest)

Invokes a simple remote call in a blocking fashion.

Declaration
public static TResponse BlockingUnaryCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call, TRequest req)
    where TRequest : class where TResponse : class
Parameters
Type Name Description
CallInvocationDetails<TRequest, TResponse> call

The call defintion.

TRequest req

Request message.

Returns
Type Description
TResponse

The response.

Type Parameters
Name Description
TRequest

Type of request message.

TResponse

The of response message.

Back to top