GRPC.Client.DNSResolver (gRPC Client v1.0.1)

Copy Markdown View Source

Dedicated process for periodic DNS re-resolution.

Linked to the parent GRPC.Client.Connection GenServer. Owns the resolve loop, backoff, rate limiting, and telemetry — keeping the Connection process focused on channel management.

Sends {:resolver_update, result} to the Connection after each resolve, where result matches the return type of GRPC.Client.Resolver.resolve/1.

Resolver contract

The :resolver option must be a module implementing the GRPC.Client.Resolver behaviour — specifically the GRPC.Client.Resolver.resolve/1 callback, which returns:

{:ok, %{addresses: [%{address: String.t(), port: integer()}], service_config: term()}}
| {:error, term()}

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts the resolver process, linked to the calling process.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

Starts the resolver process, linked to the calling process.

Options:

  • :connection_pid — pid of the owning Connection GenServer
  • :resolver — module implementing GRPC.Client.Resolver behaviour
  • :target — the DNS target string
  • :resolve_interval — base interval between resolves (ms)
  • :max_resolve_interval — backoff cap (ms)
  • :min_resolve_interval — rate-limit floor (ms)