You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/LifecycleComponent.ts
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,16 @@
1
1
/**
2
2
* Define a lifecycle component to be managed by the lifecycle manager
3
3
*/
4
-
5
4
exportabstractclassLifecycleComponent{
6
5
#components: LifecycleComponent[]=[];
7
6
/**
8
-
* Lifecycle manager will call `start` once per process lifetime. Each component's start method will be called in the sequence they were registered. Implement your component's
7
+
* Lifecycle manager will call `start` once per process lifetime. Each component's start method will be called in the sequence they were registered.
9
8
*/
10
9
abstractstart(): Promise<unknown>;
11
10
/**
12
11
* Lifecycle manager will call close once per process lifetime, in the reverse order the components are registered
13
12
*/
14
13
abstractclose(): Promise<unknown>;
15
-
/**
16
-
* Called by lifecycle manager to check the health of the component. Return true for healthy. If implemented, the lifecycle manager will call `start()` again if the component's health check returns false
17
-
*/
18
-
abstractcheckHealth?(): Promise<boolean>;
19
14
/**
20
15
* Register a child component of a lifecycle component to guarantee that its children are started in the order they are registered, and closed in the reverse order. The implementer of the lifecycle component is responsible for calling startChildComponents and closeChildComponents during start and close, respectively.
21
16
*/
@@ -34,6 +29,9 @@ export abstract class LifecycleComponent {
* Define the frequency of component health check cycles. Note: This is the interval in which the lifecycle manager will begin polling each component's status -- the interval begins once each component has returned its status. Components returning their status in a promise can delay subsequent health checks.
0 commit comments