Class GcpCallInvokerPool (4.0.0)

public sealed class GcpCallInvokerPool

A pool of GCP call invokers for the same service, but with potentially different endpoints and/or channel options. Each endpoint/options pair has a single GcpCallInvoker. All call invokers created by this pool use default application credentials. This class is thread-safe.

Inheritance

Object > GcpCallInvokerPool

Namespace

Google.Api.Gax.Grpc.Gcp

Assembly

Google.Api.Gax.Grpc.dll

Constructors

GcpCallInvokerPool(ServiceMetadata)

public GcpCallInvokerPool(ServiceMetadata serviceMetadata)

Creates a call invoker pool which will use the given service metadata to determine scopes and self-signed JWT support.

Parameter
NameDescription
serviceMetadataServiceMetadata

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

Methods

GetCallInvoker(String, GrpcChannelOptions, ApiConfig, GrpcAdapter)

public GcpCallInvoker GetCallInvoker(string endpoint, GrpcChannelOptions options, ApiConfig apiConfig, GrpcAdapter adapter)

Returns a call invoker from this pool, creating a new one if there is no call invoker already associated with endpoint and options.

Parameters
NameDescription
endpointString

The endpoint to connect to. Must not be null.

optionsGrpcChannelOptions

The options to use for each channel created by the call invoker. May be null.

apiConfigApiConfig

The API configuration used to determine channel keys. Must not be null.

adapterGrpcAdapter

The gRPC adapter to use to create call invokers. Must not be null.

Returns
TypeDescription
GcpCallInvoker

A call invoker for the specified endpoint.

GetCallInvokerAsync(String, GrpcChannelOptions, ApiConfig, GrpcAdapter)

public async Task<GcpCallInvoker> GetCallInvokerAsync(string endpoint, GrpcChannelOptions options, ApiConfig apiConfig, GrpcAdapter adapter)

Asynchronously returns a call invoker from this pool, creating a new one if there is no call invoker already associated with endpoint and options.

Parameters
NameDescription
endpointString

The endpoint to connect to. Must not be null.

optionsGrpcChannelOptions

The options to use for each channel created by the call invoker. May be null.

apiConfigApiConfig

The API configuration used to determine channel keys. Must not be null.

adapterGrpcAdapter

The gRPC adapter to use to create call invokers. Must not be null.

Returns
TypeDescription
Task<GcpCallInvoker>

A task representing the asynchronous operation. The value of the completed task will be a call invoker for the specified endpoint.

ShutdownChannelsAsync()

public Task ShutdownChannelsAsync()

Shuts down all the open channels of all currently-allocated call invokers asynchronously. This does not prevent the call invoker pool from being used later on, but the currently-allocated call invokers will not be reused.

Returns
TypeDescription
Task

A task which will complete when all the (current) channels have been shut down.