(message: 'exit' | 'progress' | 'error', listener: any)
| 105 | public async on(message: 'progress', listener: (status: WorkerStatusUpdate) => void): Promise<void>; |
| 106 | |
| 107 | public async on(message: 'exit' | 'progress' | 'error', listener: any): Promise<void> { |
| 108 | switch (message) { |
| 109 | case 'progress': { |
| 110 | this.channel.on('worker/progress', ({ data }) => { |
| 111 | listener(data.status); |
| 112 | }); |
| 113 | return; |
| 114 | } |
| 115 | |
| 116 | case 'exit': { |
| 117 | this.channel.on('worker/exit', ({ data }) => { |
| 118 | if (data.workerId === this.id) { |
| 119 | listener(data.exitCode, data.error); |
| 120 | } |
| 121 | }); |
| 122 | return; |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Terminates the shell process. |
no outgoing calls
no test coverage detected