From 109abe78646c94903ef423aeb7db213087c4b92d Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Fri, 10 Jan 2020 13:57:21 -0500 Subject: event emitter, streamlined initialization --- src/server/session/agents/applied_session_agent.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/server/session/agents/applied_session_agent.ts') diff --git a/src/server/session/agents/applied_session_agent.ts b/src/server/session/agents/applied_session_agent.ts index cb7f63c34..53293d3bf 100644 --- a/src/server/session/agents/applied_session_agent.ts +++ b/src/server/session/agents/applied_session_agent.ts @@ -8,8 +8,8 @@ export abstract class AppliedSessionAgent { // the following two methods allow the developer to create a custom // session and use the built in customization options for each thread - protected abstract async launchMonitor(): Promise; - protected abstract async launchServerWorker(): Promise; + protected abstract async initializeMonitor(monitor: Monitor): Promise; + protected abstract async initializeServerWorker(): Promise; private launched = false; @@ -43,9 +43,10 @@ export abstract class AppliedSessionAgent { if (!this.launched) { this.launched = true; if (isMaster) { - this.sessionMonitorRef = await this.launchMonitor(); + await this.initializeMonitor(this.sessionMonitorRef = Monitor.Create()); + this.sessionMonitorRef.finalize(); } else { - this.serverWorkerRef = await this.launchServerWorker(); + this.serverWorkerRef = await this.initializeServerWorker(); } } else { throw new Error("Cannot launch a session thread more than once per process."); -- cgit v1.2.3-70-g09d2