If you run a long running calculation on a remote machine your calculation can fail if the machine falls over, the network goes down, or your code crashes R. This package provides a "heartbeat" service that uses Redis to periodically prevent a key from expiring, forming a dead man's switch. You can then monitor the key to detect failure in your process and re-queue/rerun/investigate as appropriate.
f <- function() {
h <- heartbeatr::heartbeat("mykey", 4)
# ... long running job here
# h$stop() # optional - will stop automatically once h is garbage collected
}
drat:::add("mrc-ide")
install.packges("heartbeatr")
It is also possible to install directly from GitHub using remotes
as
remotes::install_github("mrc-ide/heartbeatr", ugprade = FALSE)
MIT + file LICENSE © Imperial College of Science, Technology and Medicine
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.