Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Monitor

internal

Hierarchy

Index

Constructors

constructor

Properties

[kCancellationToken]

[kCancellationToken]: CancellationToken

Optional [kConnection]

[kConnection]: Connection

Optional [kMonitorId]

internal

Optional [kRTTPinger]

[kRTTPinger]: RTTPinger

[kServer]

[kServer]: Server

address

address: string

connectOptions

connectOptions: ConnectionOptions

options

options: Readonly<Pick<MonitorOptions, "connectTimeoutMS" | "minHeartbeatFrequencyMS" | "heartbeatFrequencyMS">>

s

internal

Static Readonly captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static Readonly 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.

Methods

addListener

close

  • close(): void

connect

  • connect(): void

emit

  • emit<EventKey>(event: symbol | EventKey, ...args: Parameters<MonitorEvents[EventKey]>): boolean
  • Type parameters

    • EventKey: "close" | "serverHeartbeatStarted" | "serverHeartbeatSucceeded" | "serverHeartbeatFailed" | "stateChanged" | "resetServer" | "resetConnectionPool"

    Parameters

    • event: symbol | EventKey
    • Rest ...args: Parameters<MonitorEvents[EventKey]>

    Returns boolean

eventNames

  • eventNames(): string[]

getMaxListeners

  • getMaxListeners(): number

listenerCount

  • listenerCount<EventKey>(type: string | symbol | EventKey): number
  • Type parameters

    • EventKey: "close" | "serverHeartbeatStarted" | "serverHeartbeatSucceeded" | "serverHeartbeatFailed" | "stateChanged" | "resetServer" | "resetConnectionPool"

    Parameters

    • type: string | symbol | EventKey

    Returns number

listeners

  • listeners<EventKey>(event: string | symbol | EventKey): MonitorEvents[EventKey][]
  • Type parameters

    • EventKey: "close" | "serverHeartbeatStarted" | "serverHeartbeatSucceeded" | "serverHeartbeatFailed" | "stateChanged" | "resetServer" | "resetConnectionPool"

    Parameters

    • event: string | symbol | EventKey

    Returns MonitorEvents[EventKey][]

off

on

once

prependListener

prependOnceListener

rawListeners

  • rawListeners<EventKey>(event: string | symbol | EventKey): MonitorEvents[EventKey][]
  • Type parameters

    • EventKey: "close" | "serverHeartbeatStarted" | "serverHeartbeatSucceeded" | "serverHeartbeatFailed" | "stateChanged" | "resetServer" | "resetConnectionPool"

    Parameters

    • event: string | symbol | EventKey

    Returns MonitorEvents[EventKey][]

removeAllListeners

  • removeAllListeners<EventKey>(event?: string | symbol | EventKey): Monitor
  • Type parameters

    • EventKey: "close" | "serverHeartbeatStarted" | "serverHeartbeatSucceeded" | "serverHeartbeatFailed" | "stateChanged" | "resetServer" | "resetConnectionPool"

    Parameters

    • Optional event: string | symbol | EventKey

    Returns Monitor

removeListener

requestCheck

  • requestCheck(): void

reset

  • reset(): void

setMaxListeners

  • setMaxListeners(n: number): Monitor

Static getEventListener

  • getEventListener(emitter: DOMEventTarget | EventEmitter, name: string | symbol): Function[]
  • Returns a list listener for a specific emitter event name.

    Parameters

    • emitter: DOMEventTarget | EventEmitter
    • name: string | symbol

    Returns Function[]

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, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string
    • Optional options: StaticEventEmitterOptions

    Returns AsyncIterableIterator<any>

Static once

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

    • emitter: NodeEventTarget
    • event: string | symbol
    • Optional options: StaticEventEmitterOptions

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string
    • Optional options: StaticEventEmitterOptions

    Returns Promise<any[]>

Generated using TypeDoc