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 . All call invokers created by this pool use default application credentials. This class is thread-safe.
Namespace
Google.Api.Gax.Grpc.GcpAssembly
Google.Api.Gax.Grpc.Gcp.dll
Constructors
GcpCallInvokerPool(IEnumerable<String>)
public GcpCallInvokerPool(IEnumerable<string> scopes)
Creates a call invoker pool which will apply the specified scopes to the default application credentials if they require any.
Parameter | |
---|---|
Name | Description |
scopes | IEnumerable<String> The scopes to apply. Must not be null, and must not contain null references. May be empty. |
Methods
GetCallInvoker(String, GrpcChannelOptions)
public GcpCallInvoker GetCallInvoker(string endpoint, GrpcChannelOptions options = null)
Returns a call invoker from this pool, creating a new one if there is no call invoker
already associated with endpoint
and options
.
Parameters | |
---|---|
Name | Description |
endpoint | String The endpoint to connect to. Must not be null. |
options | GrpcChannelOptions The options to use for each channel created by the call invoker, possibly including the special option to control the behavior itself. |
Returns | |
---|---|
Type | Description |
GcpCallInvoker | A call invoker for the specified endpoint. |
GetCallInvokerAsync(String, GrpcChannelOptions)
public Task<GcpCallInvoker> GetCallInvokerAsync(string endpoint, GrpcChannelOptions options = null)
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 | |
---|---|
Name | Description |
endpoint | String The endpoint to connect to. Must not be null. |
options | GrpcChannelOptions The options to use for each channel created by the call invoker, possibly including the special option to control the behavior itself. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
Task | A task which will complete when all the (current) channels have been shut down. |