Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MergedServiceDiscovery<S>

Merge services from several discoveries.

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected Readonly availableEvent

availableEvent: Event<MergedServiceDiscovery<S>, [service: S]>

Event used to emit when a service is available.

Protected Readonly debug

debug: Debugger

Debugger that can be used to output debug messages for the discovery.

Protected Readonly unavailableEvent

unavailableEvent: Event<MergedServiceDiscovery<S>, [service: S]>

Event used to emit when a service is no longer available.

Protected Readonly updateEvent

updateEvent: Event<MergedServiceDiscovery<S>, [service: S, previousService: S]>

Event used to emit when a service has been updated.

Accessors

destroyed

  • get destroyed(): boolean

onAvailable

  • get onAvailable(): Subscribable<this, [service: S]>

onDestroy

  • get onDestroy(): Subscribable<this, []>

onError

  • get onError(): Subscribable<this, [err: Error]>

onUnavailable

  • get onUnavailable(): Subscribable<this, [service: S]>

onUpdate

  • get onUpdate(): Subscribable<this, [service: S, previousService: S]>

services

  • get services(): S[]

Methods

and

destroy

  • destroy(): Promise<void>

filter

find

findAll

get

  • get(id: string): null | S

Protected logAndEmitError

  • logAndEmitError(error: unknown, message?: string): void

map

release

  • release(): Promise<void>

Protected removeService

  • removeService(service: string | S): null | S

Protected setServices

  • setServices(available: Iterable<S>): void

Protected updateService

  • updateService(service: S): null | S
  • Add or update a service that has been found. This will register the service and emit suitable events. Services are identified internally using their identifier. Services will be treated as new if their id does is not currently tracked, and as updates if their id is currently tracked.

    Parameters

    • service: S
      • service to update

    Returns null | S

    previous service or null if not registered

Generated using TypeDoc