Table of Contents

Class GrpcChannelPool

Namespace
Virtufin.Api.Services
Assembly
Virtufin.Api.dll
public class GrpcChannelPool : IDisposable
Inheritance
GrpcChannelPool
Implements
Inherited Members

Constructors

GrpcChannelPool(ServicesConfiguration, ILogger<GrpcChannelPool>)

public GrpcChannelPool(ServicesConfiguration config, ILogger<GrpcChannelPool> logger)

Parameters

config ServicesConfiguration
logger ILogger<GrpcChannelPool>

Properties

ChannelCount

public int ChannelCount { get; }

Property Value

int

ConfiguredServiceCount

Number of services the pool can actually hold a channel for. Non-dialable entries (state-store-name placeholders) are excluded, so the health check's channels-per-service ratio stays reachable.

public int ConfiguredServiceCount { get; }

Property Value

int

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetChannelAsync(string)

public Task<GrpcChannel> GetChannelAsync(string serviceName)

Parameters

serviceName string

Returns

Task<GrpcChannel>

IsDialable(string)

True if serviceName names a registered, dialable backend.

public bool IsDialable(string serviceName)

Parameters

serviceName string

Returns

bool

Remarks

Callers check this before touching the descriptor cache. Letting an unregistered name reach the cache means the resulting ArgumentException is swallowed by LoadDescriptorsAsync and stored as LastLoadException, so the caller sees UNAVAILABLE ("could not load descriptors") plus the raw "not found in configuration" text, rather than a clean NOT_FOUND.