Class ServiceRegistry<CustomSettings>

Type Parameters

Hierarchy

  • EventEmitter
    • ServiceRegistry

Constructors

Accessors

  • get status(): "pass" | "fail" | "warn"
  • Returns "pass" | "fail" | "warn"

    Service Register status

Methods

  • Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.

    Type Parameters

    • T

      Type of the property to return

    Parameters

    • path: string | string[]

      path to the property to get

    • OptionaldefaultValue: T

      default value to return if the property is not found

    Returns undefined | T

  • Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.

    Type Parameters

    • P extends string | number | symbol

    Parameters

    • key: P

      path to the property to get

    • OptionaldefaultValue: CustomSettings[P]

      default value to return if the property is not found

    Returns undefined | CustomSettings[P]

  • Register a resource within the service observability

    Parameters

    Returns void

  • Removes all listeners, or those of the specified event.

    Parameters

    • Optionalevent: "command"

      command event

    Returns this

  • Perform the initialization of all the service resources that has been attached

    Returns Promise<void>

  • Perform the stop of all the service resources that has been attached

    Returns Promise<void>

Events

  • Add a listener for the command event, emitted when a new command is received

    Parameters

    • event: "command"

      command event

    • listener: (job: CommandJobHandler) => void

      Command event listener

    Returns this

  • Removes the specified listener from the listener array for the command event.

    Parameters

    • event: "command"

      command event

    • listener: (job: CommandJobHandler) => void

      Command event listener

    Returns this

  • Add a listener for the command event, emitted when a new command is received

    Parameters

    • event: "command"

      command event

    • listener: (job: CommandJobHandler) => void

      Command event listener

    Returns this

  • Add a listener for the command event, emitted when a new command is received. This is a one-time event, the listener will be removed after the first emission.

    Parameters

    • event: "command"

      command event

    • listener: (job: CommandJobHandler) => void

      Command event listener

    Returns this

  • Removes the specified listener from the listener array for the command event.

    Parameters

    • event: "command"

      command event

    • listener: (job: CommandJobHandler) => void

      Command event listener

    Returns this