Skip to contents

Fetch information about a task. This currently includes information about where a task is (or was) running and information about any retry chain, but will expand in future. The format of the output here is subject to change (and will probably get a nice print method) but the values present in the output will be included in any future update.

Usage

rrq_task_info(task_id, controller = NULL)

Arguments

task_id

A single task identifier

controller

The controller to use. If not given (or NULL) we'll use the controller registered with rrq_default_controller_set().

Value

A list, format currently subject to change

Examples

obj <- rrq_controller("rrq:example")

# Get information about a task
t <- rrq_task_create_expr(runif(1), controller = obj)
rrq_task_info(t, controller = obj)
#> $id
#> [1] "81eeb508a8b5796aba14d8c243197e3e"
#> 
#> $status
#> [1] "RUNNING"
#> 
#> $queue
#> [1] "default"
#> 
#> $separate_process
#> [1] FALSE
#> 
#> $timeout
#> NULL
#> 
#> $worker
#> [1] "exhaustible_umbrette"
#> 
#> $pid
#> NULL
#> 
#> $depends
#> $depends$up
#> NULL
#> 
#> $depends$down
#> NULL
#> 
#> 
#> $moved
#> $moved$up
#> NULL
#> 
#> $moved$down
#> NULL
#> 
#> 

# If the task has been retried, the retry chain is shown
rrq_task_wait(t, controller = obj)
#> [1] TRUE
rrq_task_retry(t, controller = obj)
#> [1] "e472b67ff65256914e2c9e80cb5ef7fe"
rrq_task_info(t, controller = obj)
#> $id
#> [1] "81eeb508a8b5796aba14d8c243197e3e"
#> 
#> $status
#> [1] "MOVED"
#> 
#> $queue
#> [1] "default"
#> 
#> $separate_process
#> [1] FALSE
#> 
#> $timeout
#> NULL
#> 
#> $worker
#> [1] "exhaustible_umbrette"
#> 
#> $pid
#> NULL
#> 
#> $depends
#> $depends$up
#> NULL
#> 
#> $depends$down
#> NULL
#> 
#> 
#> $moved
#> $moved$up
#> NULL
#> 
#> $moved$down
#> [1] "e472b67ff65256914e2c9e80cb5ef7fe"
#> 
#> 

# If the task was queued onto a separate process, then this
# information is shown
rrq_task_create_expr(1 + 1, separate_process = TRUE, timeout_task_run = 60,
                      controller = obj)
#> [1] "d4ac5a75af519023306f81f3f8b1e393"
rrq_task_wait(t, controller = obj)
#> [1] TRUE
rrq_task_info(t, controller = obj)
#> $id
#> [1] "81eeb508a8b5796aba14d8c243197e3e"
#> 
#> $status
#> [1] "MOVED"
#> 
#> $queue
#> [1] "default"
#> 
#> $separate_process
#> [1] FALSE
#> 
#> $timeout
#> NULL
#> 
#> $worker
#> [1] "exhaustible_umbrette"
#> 
#> $pid
#> NULL
#> 
#> $depends
#> $depends$up
#> NULL
#> 
#> $depends$down
#> NULL
#> 
#> 
#> $moved
#> $moved$up
#> NULL
#> 
#> $moved$down
#> [1] "e472b67ff65256914e2c9e80cb5ef7fe"
#> 
#>