set task function hook according to
Usage
setTaskHook(
status = c("queued", "draft", "running", "completed", "aborted", "failed"),
fun
)
getTaskHook(
status = c("queued", "draft", "running", "completed", "aborted", "failed")
)
Arguments
- status
one of "queued", "draft", "running",
"completed", "aborted", or "failed".
- fun
function it must return a TRUE or FALSE in the end of
function body, when it's TRUE this function will also terminate
monitor process, if FALSE, function called, but not going
to terminate task monitoring process.
Value
object from setHook and getHook.
Examples
getTaskHook("completed")
#> function (...)
#> {
#> cat("\r", "completed")
#> return(TRUE)
#> }
#> <environment: 0x7fdf47e9e888>
setTaskHook("completed", function() {
message("completed")
return(TRUE)
})