C# Class Google.Api.Gax.Grpc.ChannelPool

A pool of channels for the same service, but with potentially different endpoints. Each endpoint has a single channel. All channels created by this pool use default application credentials. This class is thread-safe.
Mostrar archivo Open project: googleapis/gax-dotnet

Public Methods

Method Description
ChannelPool ( IEnumerable scopes ) : Google.Apis.Auth.OAuth2

Creates a channel pool which will apply the specified scopes to the default application credentials if they require any.

GetChannel ( ServiceEndpoint endpoint ) : Grpc.Core.Channel

Returns a channel from this pool, creating a new one if there is no channel already associated with endpoint.

GetChannelAsync ( ServiceEndpoint endpoint ) : Task

Asynchronously returns a channel from this pool, creating a new one if there is no channel already associated with endpoint.

ShutdownChannelsAsync ( ) : System.Threading.Tasks.Task

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

Private Methods

Method Description
CreateChannelCredentialsUncached ( ) : Task
GetChannel ( ServiceEndpoint endpoint, Grpc.Core.ChannelCredentials credentials ) : Grpc.Core.Channel

Method Details

ChannelPool() public method

Creates a channel pool which will apply the specified scopes to the default application credentials if they require any.
public ChannelPool ( IEnumerable scopes ) : Google.Apis.Auth.OAuth2
scopes IEnumerable The scopes to apply. Must not be null, and must not contain null references. May be empty.
return Google.Apis.Auth.OAuth2

GetChannel() public method

Returns a channel from this pool, creating a new one if there is no channel already associated with endpoint.
public GetChannel ( ServiceEndpoint endpoint ) : Grpc.Core.Channel
endpoint ServiceEndpoint The endpoint to connect to. Must not be null.
return Grpc.Core.Channel

GetChannelAsync() public method

Asynchronously returns a channel from this pool, creating a new one if there is no channel already associated with endpoint.
public GetChannelAsync ( ServiceEndpoint endpoint ) : Task
endpoint ServiceEndpoint The endpoint to connect to. Must not be null.
return Task

ShutdownChannelsAsync() public method

Shuts down all the currently-allocated channels asynchronously. This does not prevent the channel pool from being used later on, but the currently-allocated channels will not be reused.
public ShutdownChannelsAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task