@midwayjs/bootstrap 3.12.3 → 3.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manager/base.d.ts +13 -13
- package/package.json +4 -4
package/dist/manager/base.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ForkOptions } from '../interface';
|
|
2
2
|
import type { IEventBus, EventBusOptions } from '@midwayjs/event-bus';
|
|
3
|
-
export declare abstract class AbstractForkManager<
|
|
3
|
+
export declare abstract class AbstractForkManager<Worker, ClusterOptions extends ForkOptions> {
|
|
4
4
|
readonly options: ClusterOptions;
|
|
5
5
|
private reforks;
|
|
6
6
|
private disconnectCount;
|
|
7
7
|
private unexpectedCount;
|
|
8
8
|
private disconnects;
|
|
9
9
|
private hub;
|
|
10
|
-
protected workers: Map<string,
|
|
11
|
-
protected eventBus: IEventBus<
|
|
10
|
+
protected workers: Map<string, Worker>;
|
|
11
|
+
protected eventBus: IEventBus<Worker>;
|
|
12
12
|
private isClosing;
|
|
13
13
|
private exitListener;
|
|
14
14
|
protected constructor(options: ClusterOptions);
|
|
15
15
|
start(): Promise<void>;
|
|
16
|
-
protected tryToRefork(oldWorker:
|
|
16
|
+
protected tryToRefork(oldWorker: Worker): void;
|
|
17
17
|
/**
|
|
18
18
|
* allow refork
|
|
19
19
|
*/
|
|
@@ -25,7 +25,7 @@ export declare abstract class AbstractForkManager<T, ClusterOptions extends Fork
|
|
|
25
25
|
/**
|
|
26
26
|
* unexpectedExit default handler
|
|
27
27
|
*/
|
|
28
|
-
protected onUnexpected(worker:
|
|
28
|
+
protected onUnexpected(worker: Worker, code: any, signal: any): void;
|
|
29
29
|
/**
|
|
30
30
|
* reachReforkLimit default handler
|
|
31
31
|
*/
|
|
@@ -33,7 +33,7 @@ export declare abstract class AbstractForkManager<T, ClusterOptions extends Fork
|
|
|
33
33
|
protected killWorker(worker: any, timeout: any): Promise<void>;
|
|
34
34
|
stop(timeout?: number): Promise<void>;
|
|
35
35
|
hasWorker(workerId: string): boolean;
|
|
36
|
-
getWorker(workerId: string):
|
|
36
|
+
getWorker(workerId: string): Worker;
|
|
37
37
|
getWorkerIds(): string[];
|
|
38
38
|
onStop(exitListener: any): void;
|
|
39
39
|
protected bindClose(): void;
|
|
@@ -47,13 +47,13 @@ export declare abstract class AbstractForkManager<T, ClusterOptions extends Fork
|
|
|
47
47
|
* @param code
|
|
48
48
|
*/
|
|
49
49
|
private onMasterExit;
|
|
50
|
-
abstract createWorker(oldWorker?:
|
|
51
|
-
abstract bindWorkerDisconnect(listener: (worker:
|
|
52
|
-
abstract bindWorkerExit(listener: (worker:
|
|
53
|
-
abstract getWorkerId(worker:
|
|
54
|
-
abstract isWorkerDead(worker:
|
|
55
|
-
abstract closeWorker(worker:
|
|
56
|
-
abstract createEventBus(eventBusOptions: EventBusOptions): IEventBus<
|
|
50
|
+
abstract createWorker(oldWorker?: Worker): Worker;
|
|
51
|
+
abstract bindWorkerDisconnect(listener: (worker: Worker) => void): void;
|
|
52
|
+
abstract bindWorkerExit(listener: (worker: Worker, code: any, signal: any) => void): void;
|
|
53
|
+
abstract getWorkerId(worker: Worker): string;
|
|
54
|
+
abstract isWorkerDead(worker: Worker): boolean;
|
|
55
|
+
abstract closeWorker(worker: Worker): any;
|
|
56
|
+
abstract createEventBus(eventBusOptions: EventBusOptions<Worker>): IEventBus<Worker>;
|
|
57
57
|
abstract isPrimary(): boolean;
|
|
58
58
|
}
|
|
59
59
|
//# sourceMappingURL=base.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/bootstrap",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.5",
|
|
4
4
|
"description": "midwayjs bootstrap",
|
|
5
|
-
"main": "dist/index",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@midwayjs/async-hooks-context-manager": "^3.12.3",
|
|
25
|
-
"@midwayjs/event-bus": "1.
|
|
25
|
+
"@midwayjs/event-bus": "1.9.4"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@midwayjs/core": "^3.12.3",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=12.11.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "24c6b9f7a3be1bf37b3182286f3e55fc418a2c99"
|
|
42
42
|
}
|