1 | import { ConfigParams } from "pip-services3-commons-node";
|
2 | import { IConfigurable } from "pip-services3-commons-node";
|
3 | import { IOpenable } from "pip-services3-commons-node";
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export declare class Shutdown implements IConfigurable, IOpenable {
|
27 | private _interval;
|
28 | private _mode;
|
29 | private _minTimeout;
|
30 | private _maxTimeout;
|
31 | |
32 |
|
33 |
|
34 | constructor();
|
35 | /**
|
36 | * Configures component by passing configuration parameters.
|
37 | *
|
38 | * @param config configuration parameters to be set.
|
39 | */
|
40 | configure(config: ConfigParams): void;
|
41 | /**
|
42 | * Checks if the component is opened.
|
43 | *
|
44 | * @returns true if the component has been opened and false otherwise.
|
45 | */
|
46 | isOpen(): boolean;
|
47 | /**
|
48 | * Opens the component.
|
49 | *
|
50 | * @param correlationId (optional) transaction id to trace execution through call chain.
|
51 | * @param callback callback function that receives error or null no errors occured.
|
52 | */
|
53 | open(correlationId: string, callback: (err: any) => void): void;
|
54 | /**
|
55 | * Closes component and frees used resources.
|
56 | *
|
57 | * @param correlationId (optional) transaction id to trace execution through call chain.
|
58 | * @param callback callback function that receives error or null no errors occured.
|
59 | */
|
60 | close(correlationId: string, callback: (err: any) => void): void;
|
61 | /**
|
62 | * Crashes the process using the configured crash mode.
|
63 | */
|
64 | shutdown(): void;
|
65 | }
|