Class Calls

public static class Calls : object

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

Object > Calls

Namespace

Grpc.Core

Assembly

Grpc.Core.dll

Methods

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

public static AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call)
    where TRequest : class where TResponse : class

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

Parameter
TypeNameDescription
CallInvocationDetails<TRequest, TResponse>call

The call definition.

Returns
TypeDescription
AsyncClientStreamingCall<TRequest, TResponse>

An awaitable call object providing access to the response.

Type Parameters
NameDescription
TRequest

Type of request messages.

TResponse

The of response message.

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

public static AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call)
    where TRequest : class where TResponse : class

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.

Parameter
TypeNameDescription
CallInvocationDetails<TRequest, TResponse>call

The call definition.

Returns
TypeDescription
AsyncDuplexStreamingCall<TRequest, TResponse>

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

Type Parameters
NameDescription
TRequest

Type of request messages.

TResponse

Type of responsemessages.

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

public static AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call, TRequest req)
    where TRequest : class where TResponse : class

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

Parameters
TypeNameDescription
CallInvocationDetails<TRequest, TResponse>call

The call definition.

TRequestreq

Request message.

Returns
TypeDescription
AsyncServerStreamingCall<TResponse>

A call object providing access to the asynchronous response stream.

Type Parameters
NameDescription
TRequest

Type of request message.

TResponse

The of response messages.

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

public static AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call, TRequest req)
    where TRequest : class where TResponse : class

Invokes a simple remote call asynchronously.

Parameters
TypeNameDescription
CallInvocationDetails<TRequest, TResponse>call

The call definition.

TRequestreq

Request message.

Returns
TypeDescription
AsyncUnaryCall<TResponse>

An awaitable call object providing access to the response.

Type Parameters
NameDescription
TRequest

Type of request message.

TResponse

The of response message.

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

public static TResponse BlockingUnaryCall<TRequest, TResponse>(CallInvocationDetails<TRequest, TResponse> call, TRequest req)
    where TRequest : class where TResponse : class

Invokes a simple remote call in a blocking fashion.

Parameters
TypeNameDescription
CallInvocationDetails<TRequest, TResponse>call

The call definition.

TRequestreq

Request message.

Returns
TypeDescription
TResponse

The response.

Type Parameters
NameDescription
TRequest

Type of request message.

TResponse

The of response message.