method IServiceDiscovery.pick
IServiceDiscovery.pick(
serviceName: string,
options?: PickOptions
): Promise<ServiceInstance | null>

Chooses one instance, skipping ejected ones.

Parameters

serviceName: string

Logical service name

optional
options: PickOptions

Per-call strategy override

Return Type

Promise<ServiceInstance | null>

The chosen instance, or null when the service has none

Usage

import { type IServiceDiscovery } from "common/src/index.ts";