本文整理匯總了TypeScript中tree-kill類的典型用法代碼示例。如果您正苦於以下問題:TypeScript tree-kill類的具體用法?TypeScript tree-kill怎麽用?TypeScript tree-kill使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了tree-kill類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
window.showQuickPick(items).then((value) => {
if(value) {
outputChannel.appendLine('');
outputChannel.appendLine(`Killing process ${value.label} (pid: ${value.pid})`);
outputChannel.appendLine('');
kill(value.pid, 'SIGTERM');
}
});
示例2: Promise
return new Promise((resolve, reject) => {
treeKill(pid, 'SIGTERM', err => {
if (err) {
reject();
} else {
resolve();
}
});
});
示例3: async
bundlerProcess.on("exit", async () => {
electronProcess.removeAllListeners("exit");
// tslint:disable-next-line:no-console
console.info("Webpack dev server exited, terminating.");
const deferred = createDeferred();
treeKill(electronProcess.pid, "SIGHUP", () => deferred.resolve());
await deferred.promise;
});
示例4: Promise
return new Promise((resolve, reject) => {
kill(pid, signal, err => {
if (err) {
debug('error while killing process tree for %d: %O', pid, err);
return reject(err);
}
resolve();
});
});
示例5: kill
kill: () => {
kill(task.pid);
}
示例6: setTimeout
setTimeout(() => {
kill(proc.pid, 'SIGTERM', () => {
expect(exitCode).not.toBeNull();
done();
});
}, 1000);