<PackageReference Include="Grpc.Net.Client" Version="2.71.0-pre1" />

Grpc.Net.Client.Balancer.Resolver

public abstract class Resolver : IDisposable
A configurable component that resolves a target Uri and returns them to the caller. The targets URI's scheme is used to select the Resolver implementation, and uses the URI parts after the scheme for actual resolution.

The addresses of a target may change over time, thus the caller registers a callback to receive continuous updates as ResolverResult.

A Resolver doesn't need to automatically re-resolve on failure. Instead, the callback is responsible for eventually invoking Refresh.

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

protected Resolver()

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 Resolver. Stops resolution.

public virtual void Refresh()

Refresh resolution. Can only be called after Start. The default implementation is no-op.

This is only a hint. Implementation takes it as a signal but may not start resolution.

public abstract void Start(Action<ResolverResult> listener)

Starts listening to resolver for results with the specified callback. Can only be called once.

The ResolverResult passed to the callback has addresses when successful, otherwise a Status details the resolution error.