Given a process id (pid), watches the process, and if the process dies, then takes an action given by the supplied function. Also able to take action if the process is still alive.
Usage
ft_watch_pid(
pid = NULL,
dead_action = function() {
ft_notify_success_error(NULL, "it died")
},
alive_action = NULL,
check_interval = 60
)Examples
if (FALSE) { # \dontrun{
use_pid = ps::ps_pid()
alive_action = function(){ft_notify_success_error(NULL, "it's running!")}
dead_action = function(){ft_notify_success_error(NULL, "it died")}
ft_watch_pid(use_pid, alive_action = alive_action, dead_action = dead_action)
} # }