MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / started

Method started

daemon/src/entity/instance/instance.ts:356–370  ·  view source on GitHub ↗
(process: IInstanceProcess)

Source from the content-addressed store, hash-verified

354 // function that must be executed after the instance starts
355 // Trigger the open event and bind the data and exit events, etc.
356 started(process: IInstanceProcess) {
357 this.config.lastDatetime = Date.now();
358 const outputCode = this.config.terminalOption.pty ? "utf-8" : this.config.oe;
359 process.on("data", (text: any) => {
360 this.pushOutput(iconv.decode(text, outputCode));
361 });
362 process.on("exit", (code: number) => this.stopped(code));
363 this.process = process;
364 this.instanceStatus = Instance.STATUS_RUNNING;
365 this.emit("open", this);
366
367 // start all lifecycle tasks
368 this.lifeCycleTaskManager.execLifeCycleTask(1);
369 this.startOutputLoop();
370 }
371
372 // If the instance performs any operation exception, it must throw an exception through this function
373 // trigger failure event

Callers 4

createProcessMethod · 0.80
createProcessMethod · 0.80
createProcessMethod · 0.80
createProcessMethod · 0.80

Calls 6

pushOutputMethod · 0.95
stoppedMethod · 0.95
startOutputLoopMethod · 0.95
onMethod · 0.80
emitMethod · 0.80
execLifeCycleTaskMethod · 0.80

Tested by

no test coverage detected