Class GcpCallInvoker (4.4.0)

public sealed class GcpCallInvoker : CallInvoker

Call invoker which can fan calls out to multiple underlying channels based on request properties.

Inheritance

object > CallInvoker > GcpCallInvoker

Namespace

Google.Api.Gax.Grpc.Gcp

Assembly

Google.Api.Gax.Grpc.dll

Constructors

GcpCallInvoker(ServiceMetadata, string, ChannelCredentials, GrpcChannelOptions, ApiConfig, GrpcAdapter)

public GcpCallInvoker(ServiceMetadata serviceMetadata, string target, ChannelCredentials credentials, GrpcChannelOptions options, ApiConfig apiConfig, GrpcAdapter adapter)

Initializes a new instance.

Parameters
NameDescription
serviceMetadataServiceMetadata

The metadata for the service that this call invoker will be used with. Must not be null.

targetstring

Target of the underlying grpc channels. Must not be null.

credentialsChannelCredentials

Credentials to secure the underlying grpc channels. Must not be null.

optionsGrpcChannelOptions

Channel options to be used by the underlying grpc channels. Must not be null.

apiConfigApiConfig

The API config to apply. Must not be null.

adapterGrpcAdapter

The adapter to use to create channels. Must not be null.

Methods

AsyncClientStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse>, string, CallOptions)

public override AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options) 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.

Parameters
NameDescription
methodMethod
hoststring
optionsCallOptions
Returns
TypeDescription
AsyncClientStreamingCall
Type Parameters
NameDescription
TRequest
TResponse
Overrides

AsyncDuplexStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse>, string, CallOptions)

public override AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options) 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.

Parameters
NameDescription
methodMethod
hoststring
optionsCallOptions
Returns
TypeDescription
AsyncDuplexStreamingCall
Type Parameters
NameDescription
TRequest
TResponse
Overrides

AsyncServerStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse>, string, CallOptions, TRequest)

public override AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) 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
NameDescription
methodMethod
hoststring
optionsCallOptions
requestTRequest
Returns
TypeDescription
AsyncServerStreamingCall
Type Parameters
NameDescription
TRequest
TResponse
Overrides

AsyncUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse>, string, CallOptions, TRequest)

public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) where TRequest : class where TResponse : class

Invokes a simple remote call asynchronously.

Parameters
NameDescription
methodMethod
hoststring
optionsCallOptions
requestTRequest
Returns
TypeDescription
AsyncUnaryCall
Type Parameters
NameDescription
TRequest
TResponse
Overrides

BlockingUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse>, string, CallOptions, TRequest)

public override TResponse BlockingUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) where TRequest : class where TResponse : class

Invokes a simple remote call in a blocking fashion.

Parameters
NameDescription
methodMethod
hoststring
optionsCallOptions
requestTRequest
Returns
TypeDescription
TResponse
Type Parameters
NameDescription
TRequest
TResponse
Overrides

ShutdownAsync()

public Task ShutdownAsync()

Shuts down the all channels in the underlying channel pool cleanly. It is strongly recommended to shutdown all previously created channels before exiting from the process.

Returns
TypeDescription
Task