MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / waitForServiceDeath

Function waitForServiceDeath

src/back/util/misc.ts:306–320  ·  view source on GitHub ↗
(service: ManagedChildProcess)

Source from the content-addressed store, hash-verified

304}
305
306export 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
322export function setStatus<T extends keyof StatusState>(state: BackState, key: T, val: StatusState[T]): void {
323 switch (key) {

Callers 1

removeServiceFunction · 0.85

Calls 3

killMethod · 0.80
onMethod · 0.65
getStateMethod · 0.45

Tested by

no test coverage detected