I'm adding a ps_is_alive() for my own package, and was wondering if you'd consider a PR here.
It caught me by surprise when ps_is_running() returned FALSE for a sleeping process on Linux. I know now that this is documented and expected behavior, but it still left me needing a way to determine if a process was in any of the alive states described by ps_status().
ps_is_alive <- function(p = ps_handle()) {
assert_ps_handle(p)
alive <- c("idle", "running", "sleeping", "disk_sleep", "uninterruptible", "waking")
isTRUE(try(silent = TRUE, ps_status(p) %in% alive))
}
I'm adding a
ps_is_alive()for my own package, and was wondering if you'd consider a PR here.It caught me by surprise when
ps_is_running()returnedFALSEfor a sleeping process on Linux. I know now that this is documented and expected behavior, but it still left me needing a way to determine if a process was in any of the alive states described byps_status().