-
Notifications
You must be signed in to change notification settings - Fork 121
/
App.ts
32 lines (28 loc) · 886 Bytes
/
App.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import type { ClusterManager } from './cluster/ClusterManager';
import type { Finalizable } from './final/Finalizable';
import type { Initializer } from './Initializer';
/**
* Entry point for the entire Solid server.
*/
export class App {
private readonly initializer: Initializer;
private readonly finalizer: Finalizable;
public readonly clusterManager: ClusterManager;
public constructor(initializer: Initializer, finalizer: Finalizable, clusterManager: ClusterManager) {
this.initializer = initializer;
this.finalizer = finalizer;
this.clusterManager = clusterManager;
}
/**
* Initializes and starts the application.
*/
public async start(): Promise<void> {
await this.initializer.handleSafe();
}
/**
* Stops the application and handles cleanup.
*/
public async stop(): Promise<void> {
await this.finalizer.finalize();
}
}