MCPcopy
hub / github.com/xpf0000/FlyEnv / send

Method send

src/main/core/ForkManager.ts:115–141  ·  view source on GitHub ↗
(...args: any)

Source from the content-addressed store, hash-verified

113 }
114
115 send(...args: any) {
116 return new ForkPromise((resolve, reject, on) => {
117 clearTimeout(this.destroyTimer)
118 this.taskFlag.push(1)
119 const thenKey = uuid()
120 this.callback[thenKey] = {
121 resolve,
122 on
123 }
124 let child = this.child
125 if (this.isChildDisabled()) {
126 console.log('this.isChildDisabled !!!!', this.childExited, this?.pid)
127 this.loading = true
128 child = utilityProcess.fork(this.forkFile)
129 child.on('message', this.onMessage)
130 child.on('error', this.onError)
131 child.on('exit', this.onExit)
132 child.on('spawn', this.onSpawn)
133 console.log('this.isChildDisabled pid: ', child.pid)
134 } else {
135 console.log('!!!! this.isChildDisabled Not')
136 }
137 child.postMessage({ Server: JSON.parse(JSON.stringify(Server)) })
138 child.postMessage([thenKey, ...args])
139 this.child = child
140 })
141 }
142
143 destroy() {
144 this.childExited = true

Callers 15

readFileFixedFunction · 0.45
writeFileByRootFunction · 0.45
callForkFunction · 0.45
callForkFunction · 0.45
sendMethod · 0.45
callForkFunction · 0.45
logMethod · 0.45
realtime_sseStopMethod · 0.45
realtime_sseConnectMethod · 0.45
mime_typesMethod · 0.45
ip_addressMethod · 0.45
ip_address_listMethod · 0.45

Calls 6

isChildDisabledMethod · 0.95
uuidFunction · 0.90
pushMethod · 0.80
logMethod · 0.45
onMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected