(...args: any)
| 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 |
no test coverage detected