killGracefully method
Implementation
Future<int> killGracefully(
Process process, {
bool debugLogging = false,
}) async {
final processId = process.pid;
if (debugLogging) {
print('Sending SIGTERM to $processId.');
}
await cancelAllStreamSubscriptions();
Process.killPid(processId);
return process.exitCode.timeout(
killTimeout,
onTimeout: () => killForcefully(process, debugLogging: debugLogging),
);
}