Options
All
  • Public
  • Public/Protected
  • All
Menu

  subscribe now with sterfive to access the online-user manual

Hierarchy

  • EventEmitter
    • WatchDog

Index

Constructors

constructor

  • Returns WatchDog

Properties

Readonly Static captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static emptyKeepAlive

emptyKeepAlive: () => void

Type declaration

    • (): void
    • Returns void

Readonly Static errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Accessors

subscriberCount

  • get subscriberCount(): number
  • returns the number of subscribers using the WatchDog object.

    Returns number

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): WatchDog
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns WatchDog

addSubscriber

  • addSubscriber(subscriber: ISubscriber, timeout: number): number
  • add a subscriber to the WatchDog.

    method

    addSubscriber

    add a subscriber to the WatchDog.

    This method modifies the subscriber be adding a new method to it called 'keepAlive' The subscriber must also provide a "watchdogReset". watchdogReset will be called if the subscriber failed to call keepAlive withing the timeout period.

    Parameters

    Returns number

    the numerical key associated with this subscriber

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getCurrentSystemTick

  • getCurrentSystemTick(): number
  • Returns number

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(event: string | symbol): number
  • Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): WatchDog
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns WatchDog

on

  • on(event: string | symbol, listener: (...args: any[]) => void): WatchDog
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns WatchDog

once

  • once(event: string | symbol, listener: (...args: any[]) => void): WatchDog
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns WatchDog

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): WatchDog
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns WatchDog

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): WatchDog
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns WatchDog

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): WatchDog
  • Parameters

    • Optional event: string | symbol

    Returns WatchDog

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): WatchDog
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns WatchDog

removeSubscriber

  • Parameters

    Returns void

setMaxListeners

  • Parameters

    • n: number

    Returns WatchDog

shutdown

  • shutdown(): void
  • Returns void

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>

Generated using TypeDoc