Setu-TS
    Preparing search index...

    Interface DiscoveryProvider

    A discovery backend.

    The plugin's caching, balancing, and ejection all sit above this port, so a provider only has to answer "who is running this service" and, where its backend supports it, "tell me when that changes".

    0.2.0

    interface DiscoveryProvider {
        kind: string;
        deregisterSelf?(registration: SelfRegistration): Promise<void>;
        isHealthy?(): Promise<boolean>;
        registerSelf?(registration: SelfRegistration): Promise<void>;
        resolve(serviceName: string): Promise<readonly ServiceInstance[]>;
        watch(
            serviceName: string,
            listener: (instances: readonly ServiceInstance[]) => void,
        ): Promise<Unsubscribe>;
    }

    Implemented by

    Index
    kind: string

    Backend id, surfaced by the health indicator.

    • M70c: reports whether the discovery backend is reachable right now, for the plugin's health indicator.

      Optional: a provider with no meaningful liveness check omits it, and the indicator then relies on the service's everResolved state. This answers a fact (reachability), not a policy: the indicator owns the up/degraded/ down mapping.

      Returns Promise<boolean>

      true when the backend is reachable

      0.2.0

    • Subscribes to instance-list changes.

      Push-based where the backend supports it, interval-polled where it does not. The listener always receives the full list.

      Parameters

      • serviceName: string

        Logical service name

      • listener: (instances: readonly ServiceInstance[]) => void

        Called with the full instance list on every change

      Returns Promise<Unsubscribe>

      Unsubscribe function that stops the underlying watch