<PackageReference Include="Grpc.Net.Client" Version="2.80.0" />

Grpc.Net.Client.Balancer.LoadBalancer

public abstract class LoadBalancer : IDisposable
A configurable component that receives resolved addresses from Resolver and provides a usable Subchannel when asked.

A new load balancer implements: LoadBalancerFactory creates new LoadBalancer instances. LoadBalancer receives results from the Resolver, subchannels' connectivity states, and requests to create a connection and shutdown. LoadBalancer creates Subchannel instances from resolve results using IChannelControlHelper, and updates the channel state with a ConnectivityState and SubchannelPicker. SubchannelPicker makes a load balancing decision.

Note: Experimental API that can change or be removed without any prior notice.

protected LoadBalancer()

protected virtual void Dispose(bool disposing)

Releases the unmanaged resources used by the LoadBalancer and optionally releases the managed resources.

public void Dispose()

Disposes the LoadBalancer. The load balancer state is updated to Shutdown. state

public abstract void RequestConnection()

Request the LoadBalancer to establish connections now (if applicable) so that future calls can use a ready connection without waiting for a connection.

public abstract void UpdateChannelState(ChannelState state)

Updates the LoadBalancer with state from the Resolver.