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.
[Obsolete("Please use the overloads that accept a universe domain to make certain the credentials used are valid in the target universe domain.")]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.
[Obsolete("Please use the overloads that accept a universe domain to make certain the credentials used are valid in the target universe domain.")]public 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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGcpCallInvokerPool\u003c/code\u003e class manages a pool of GCP call invokers for a specific service, accommodating different endpoints and channel options.\u003c/p\u003e\n"],["\u003cp\u003eIt ensures thread safety and utilizes default application credentials for all call invokers it creates.\u003c/p\u003e\n"],["\u003cp\u003eThe pool creates new call invokers as needed for specific endpoint and options combinations via the \u003ccode\u003eGetCallInvoker\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThere are asynchronous variations of \u003ccode\u003eGetCallInvoker\u003c/code\u003e, such as \u003ccode\u003eGetCallInvokerAsync\u003c/code\u003e, to handle the creation of new invokers with tasks, and \u003ccode\u003eShutdownChannelsAsync\u003c/code\u003e to terminate currently allocated call invokers asynchronously.\u003c/p\u003e\n"],["\u003cp\u003eThe class can be initialized with \u003ccode\u003eServiceMetadata\u003c/code\u003e, and when retrieving call invokers, it can optionally take in a \u003ccode\u003euniverseDomain\u003c/code\u003e to ensure the validity of the credentials.\u003c/p\u003e\n"]]],[],null,["# Class GcpCallInvokerPool (4.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.10.0 (latest)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.Gcp.GcpCallInvokerPool)\n- [4.8.0](/dotnet/docs/reference/Google.Api.Gax/4.8.0/Google.Api.Gax.Grpc.Gcp.GcpCallInvokerPool)\n- [4.4.0](/dotnet/docs/reference/Google.Api.Gax/4.4.0/Google.Api.Gax.Grpc.Gcp.GcpCallInvokerPool)\n- [4.3.1](/dotnet/docs/reference/Google.Api.Gax/4.3.1/Google.Api.Gax.Grpc.Gcp.GcpCallInvokerPool)\n- [4.2.0](/dotnet/docs/reference/Google.Api.Gax/4.2.0/Google.Api.Gax.Grpc.Gcp.GcpCallInvokerPool)\n- [4.0.0](/dotnet/docs/reference/Google.Api.Gax/4.0.0/Google.Api.Gax.Grpc.Gcp.GcpCallInvokerPool)\n- [3.2.0](/dotnet/docs/reference/Google.Api.Gax/3.2.0/Google.Api.Gax.Grpc.Gcp.GcpCallInvokerPool) \n\n public sealed class GcpCallInvokerPool\n\nA pool of GCP call invokers for the same service, but with potentially different endpoints and/or channel options.\nEach endpoint/options pair has a single [GcpCallInvoker](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.Gcp.GcpCallInvoker). All call invokers created by this pool use\ndefault application credentials. This class is thread-safe. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e GcpCallInvokerPool \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Api.Gax.Grpc.Gcp](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.Gcp)\n\nAssembly\n--------\n\nGoogle.Api.Gax.Grpc.dll\n\nConstructors\n------------\n\n### GcpCallInvokerPool(ServiceMetadata)\n\n public GcpCallInvokerPool(ServiceMetadata serviceMetadata)\n\nCreates a call invoker pool which will use the given service metadata to determine scopes\nand self-signed JWT support.\n\nMethods\n-------\n\n### GetCallInvoker(string, GrpcChannelOptions, ApiConfig, GrpcAdapter)\n\n [Obsolete(\"Please use the overloads that accept a universe domain to make certain the credentials used are valid in the target universe domain.\")]\n public GcpCallInvoker GetCallInvoker(string endpoint, GrpcChannelOptions options, ApiConfig apiConfig, GrpcAdapter adapter)\n\nReturns a call invoker from this pool, creating a new one if there is no call invoker\nalready associated with `endpoint` and `options`.\n\n### GetCallInvoker(string, string, GrpcChannelOptions, ApiConfig, GrpcAdapter)\n\n public GcpCallInvoker GetCallInvoker(string universeDomain, string endpoint, GrpcChannelOptions options, ApiConfig apiConfig, GrpcAdapter adapter)\n\nReturns a call invoker from this pool, creating a new one if there is no call invoker\nalready associated with `endpoint` and `options`.\n\n### GetCallInvokerAsync(string, GrpcChannelOptions, ApiConfig, GrpcAdapter)\n\n [Obsolete(\"Please use the overloads that accept a universe domain to make certain the credentials used are valid in the target universe domain.\")]\n public Task\u003cGcpCallInvoker\u003e GetCallInvokerAsync(string endpoint, GrpcChannelOptions options, ApiConfig apiConfig, GrpcAdapter adapter)\n\nAsynchronously returns a call invoker from this pool, creating a new one if there is no call invoker\nalready associated with `endpoint` and `options`.\n\n### GetCallInvokerAsync(string, string, GrpcChannelOptions, ApiConfig, GrpcAdapter, CancellationToken)\n\n public Task\u003cGcpCallInvoker\u003e GetCallInvokerAsync(string universeDomain, string endpoint, GrpcChannelOptions options, ApiConfig apiConfig, GrpcAdapter adapter, CancellationToken cancellationToken)\n\nAsynchronously returns a call invoker from this pool, creating a new one if there is no call invoker\nalready associated with `endpoint` and `options`.\n\n### ShutdownChannelsAsync()\n\n public Task ShutdownChannelsAsync()\n\nShuts down all the open channels of all currently-allocated call invokers asynchronously. This does not prevent\nthe call invoker pool from being used later on, but the currently-allocated call invokers will not be reused."]]