@clairejs/server 3.22.4 → 3.22.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/README.md
CHANGED
|
@@ -12,10 +12,9 @@ export declare class LambdaWrapper {
|
|
|
12
12
|
protected readonly serverFactory: () => Promise<ClaireServer>;
|
|
13
13
|
protected readonly requestMapper: (event: any) => RequestOptions | undefined;
|
|
14
14
|
protected readonly config?: LambdaWrapperConfig | undefined;
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
private readonly jobScheduler?;
|
|
15
|
+
private httpRequestHandler?;
|
|
16
|
+
private socketManager?;
|
|
17
|
+
private jobScheduler?;
|
|
19
18
|
private _server?;
|
|
20
19
|
constructor(serverFactory: () => Promise<ClaireServer>, requestMapper: (event: any) => RequestOptions | undefined, config?: LambdaWrapperConfig | undefined);
|
|
21
20
|
private bootServer;
|
|
@@ -66,7 +66,6 @@ export class LambdaWrapper {
|
|
|
66
66
|
serverFactory;
|
|
67
67
|
requestMapper;
|
|
68
68
|
config;
|
|
69
|
-
injector = getServiceProvider().getInjector();
|
|
70
69
|
httpRequestHandler;
|
|
71
70
|
socketManager;
|
|
72
71
|
jobScheduler;
|
|
@@ -76,14 +75,15 @@ export class LambdaWrapper {
|
|
|
76
75
|
this.requestMapper = requestMapper;
|
|
77
76
|
this.config = config;
|
|
78
77
|
this.handler = this.handler.bind(this);
|
|
79
|
-
this.socketManager = this.injector.resolveOptional(AbstractServerSocketManager);
|
|
80
|
-
this.httpRequestHandler = this.injector.resolveOptional(AbstractHttpRequestHandler);
|
|
81
|
-
this.jobScheduler = this.injector.resolveOptional(AwsJobScheduler);
|
|
82
78
|
}
|
|
83
79
|
async bootServer() {
|
|
84
80
|
if (!this._server) {
|
|
81
|
+
const injector = getServiceProvider().getInjector();
|
|
85
82
|
this._server = await this.serverFactory();
|
|
86
|
-
|
|
83
|
+
this.socketManager = injector.resolveOptional(AbstractServerSocketManager);
|
|
84
|
+
this.httpRequestHandler = injector.resolveOptional(AbstractHttpRequestHandler);
|
|
85
|
+
this.jobScheduler = injector.resolveOptional(AwsJobScheduler);
|
|
86
|
+
await injector.initInstances();
|
|
87
87
|
this.socketManager?.configure();
|
|
88
88
|
await this._server.init();
|
|
89
89
|
}
|