Kill the current process with SIGKILL preemptively checking whether PID has been reused. On Windows it uses TerminateProcess().

ps_kill(p)

Arguments

p

Process handle.

See also

Examples

px <- processx::process$new("sleep", "10")
p <- ps_handle(px$get_pid())
p
ps_kill(p)
p
ps_is_running(p)
px$get_exit_status()