method StaticProvider.prototype.watch
StaticProvider.prototype.watch(
serviceName: string,
listener: (instances: readonly ServiceInstance[]) => void
): Promise<Unsubscribe>

Fires once with the configured list and never again.

The list is immutable by construction, so there is nothing further to report. Delivering it on a timer rather than synchronously means a caller that subscribes and then reads has the same ordering it would get from a real backend.

Parameters

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

Return Type

Promise<Unsubscribe>

Usage

import { StaticProvider } from "service-discovery-plugin/src/index.ts";