# CoordinatedStartup

`class` in `core/node` · v0.5.0

<https://docs.seedcord.org/packages/core/0.5.0/classes/coordinated-startup>

```ts
class CoordinatedStartup extends CoordinatedLifecycle<StartupPhase>
```

## Constructors

### constructor

```ts
CoordinatedStartup()
```

Constructs a new instance of the `CoordinatedStartup` class

## Properties

### logger

```ts
protected readonly logger: Logger
```

### phaseEnum

```ts
protected readonly phaseEnum: Record<number, string>
```

### phaseOrder

```ts
protected readonly phaseOrder: TPhase[]
```

### tasksMap

```ts
protected readonly tasksMap: Map<TPhase, LifecycleTask[]>
```

## Methods

### addTask

```ts
public addTask(
    phase: StartupPhase,
    taskName: string,
    task: () => Promise<void>,
    timeoutMs?: number
): void
```

### canAddTask

```ts
protected canAddTask(): boolean
```

### canRemoveTask

```ts
protected canRemoveTask(): boolean
```

### executeTasksInPhase

```ts
protected async executeTasksInPhase(
    phase: StartupPhase,
    tasks: LifecycleTask[]
): Promise<PromiseSettledResult<void>[]>
```

### getTaskType

```ts
protected getTaskType(): string
```

### isAborted

```ts
protected isAborted(): boolean
```

### removeTask

```ts
removeTask(
    phase: TPhase,
    taskName: string
): boolean
```

### runPhase

```ts
protected async runPhase(phase: TPhase): Promise<void>
```

### runTaskWithTimeout

```ts
protected async runTaskWithTimeout(
    phase: TPhase,
    task: LifecycleTask
): Promise<void>
```
