Skip to main content
Version: 4.0

abstractEventManager

Hierarchy

Index

Constructors

constructor

Methods

close

  • close(): Promise<void>
  • Stops the persistState event interval and emits the final persistState event. The next on() call starts the manager again.


    Returns Promise<void>

emit

  • emit(event, ...args): void

init

  • init(): Promise<void>
  • Takes over the lifecycle of the event manager: whoever calls this is expected to call close() as well. Without it, the manager starts itself with the first listener and emits a final persistState event before the process exits.

    A subclass that needs to await something to start (e.g. a connection) does so here, which is why such a manager has to be initialized explicitly.


    Returns Promise<void>

isInitialized

  • isInitialized(): boolean
  • Returns boolean

off

  • off(event, listener): void
  • Parameters

    Returns void

on

  • on(event, listener): void
  • Parameters

    Returns void