class CoordinatedStartup extends CoordinatedLifecycle<
StartupPhase,
CoordinatedStartupEvents
>class CoordinatedStartup extends CoordinatedLifecycle<
StartupPhase,
CoordinatedStartupEvents
>Member visibility
Filter class members by access level.
Showing members with Protected visibility and higher.
logger
Inherited from:CoordinatedLifecycle
phaseEnum
phaseOrder
protected readonly phaseOrder: TPhase[]protected readonly phaseOrder: TPhase[]Inherited from:CoordinatedLifecycle
tasksMap
protected readonly tasksMap: Map<TPhase, LifecycleTask[]>protected readonly tasksMap: Map<TPhase, LifecycleTask[]>Inherited from:CoordinatedLifecycle
addListener()
Alias of onon for compatibility with Node.js EventEmitter APIs.
eventThe event name to attach to
listenerCallback operating on the typed argument tuple for the event
Inherited from:StrictEventEmitter
phaseThe startup phase from StartupPhaseStartupPhase
taskNameUnique identifier for the task
taskAsync function to execute
timeoutMsTask timeout in milliseconds
emit()
Emits an event with the strictly typed argument tuple for the event name.
eventThe event name to emit
argsTuple payload for the event
Inherited from:StrictEventEmitter
eventNamesTyped()
Returns the list of event names known to the emitter with the mapped key type.
eventNamesTyped(): SEEventKey<TEvents>[]eventNamesTyped(): SEEventKey<TEvents>[]Inherited from:StrictEventEmitter
protected async executeTasksInPhase(
phase: StartupPhase,
tasks: LifecycleTask[]
): Promise<PromiseSettledResult<void>[]>protected async executeTasksInPhase(
phase: StartupPhase,
tasks: LifecycleTask[]
): Promise<PromiseSettledResult<void>[]>listenerCountTyped()
Counts listeners for an event without widening the return type of listenerCountlistenerCount.
eventThe event name to inspect
Inherited from:StrictEventEmitter
listeners()
Retrieves the listener list for a given event with the correct tuple signature.
eventThe event name to inspect
Inherited from:StrictEventEmitter
off()
Removes a previously registered listener for the given event.
eventThe event name whose listener should be removed
listenerCallback originally registered for the event
Inherited from:StrictEventEmitter
on()
Registers a persistent listener with tuple-safe arguments for the given event.
eventThe event name to attach to
listenerCallback operating on the typed argument tuple for the event
Inherited from:StrictEventEmitter
once()
Registers a one time listener that is removed after the first invocation.
eventThe event name to attach to
listenerCallback operating on the typed argument tuple for the event
Inherited from:StrictEventEmitter
removeListener()
Alias of offoff for compatibility with Node.js EventEmitter APIs.
eventThe event name whose listener should be removed
listenerCallback originally registered for the event
Inherited from:StrictEventEmitter
removeTask()
Removes a lifecycle task from a specific phase.
phaseThe lifecycle phase to remove the task from
taskNameName of the task to remove
Inherited from:CoordinatedLifecycle
Throws:
An ErrorError If startup fails or is called multiple times
runPhase()
Run all tasks in a specific phase
Inherited from:CoordinatedLifecycle
protected async runTaskWithTimeout(
phase: StartupPhase,
task: LifecycleTask
): Promise<void>protected async runTaskWithTimeout(
phase: StartupPhase,
task: LifecycleTask
): Promise<void>waitFor()
Waits for an event to be emitted, resolving with the listener arguments tuple once triggered. Supports optional abort signals and timeouts for cancellation semantics.
async waitFor<TEventKey>(
event: TEventKey,
opts?: { signal?: AbortSignal; timeoutMs?: number }
): Promise<TEvents[TEventKey]>async waitFor<TEventKey>(
event: TEventKey,
opts?: { signal?: AbortSignal; timeoutMs?: number }
): Promise<TEvents[TEventKey]>eventThe event name to wait for
optsOptional abort signal or timeout in milliseconds
Inherited from:StrictEventEmitter