abstractEventManager
Hierarchy
- EventManager
Index
Constructors
Methods
Constructors
constructor
Parameters
options: EventManagerOptions
Returns EventManager
Methods
close
Returns Promise<void>
emit
Parameters
event: EventTypeName
rest...args: unknown[]
Returns void
init
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 finalpersistStateevent 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
Returns boolean
off
Parameters
event: EventTypeName
optionallistener: (...args) => any
Returns void
on
Parameters
event: EventTypeName
listener: (...args) => any
Returns void
Stops the
persistStateevent interval and emits the finalpersistStateevent. The nexton()call starts the manager again.