(service: ManagedChildProcess)
| 304 | } |
| 305 | |
| 306 | export async function waitForServiceDeath(service: ManagedChildProcess) : Promise<void> { |
| 307 | if (service.getState() !== ProcessState.STOPPED) { |
| 308 | return new Promise((resolve) => { |
| 309 | service.on('change', onChange); |
| 310 | service.kill(); |
| 311 | |
| 312 | function onChange() { |
| 313 | if (service.getState() === ProcessState.STOPPED) { |
| 314 | service.off('change', onChange); |
| 315 | resolve(); |
| 316 | } |
| 317 | } |
| 318 | }); |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | export function setStatus<T extends keyof StatusState>(state: BackState, key: T, val: StatusState[T]): void { |
| 323 | switch (key) { |
no test coverage detected