setTaskHook {sevenbridges} | R Documentation

## set task function hook

### Description

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")
    setTaskHook("completed", function() {
      message("completed")
      return(TRUE)
    })

[Package sevenbridges version 1.24.0 Index]