Run a task that has been created by a task_create_*
function,
e.g., task_create_explicit()
, task_create_expr()
. Generally
users should not run this function directly.
Arguments
- id
The task identifier
- envir
An environment in which to evaluate the expression. For non-testing purposes, generally ignore this, the global environment will be likely the expected environment.
- verbose
Logical, indicating if we should print information about what we do as we do it.
- root
A hipercow root, or path to it. If
NULL
we search up your directory tree.
Examples
cleanup <- hipercow_example_helper(runner = FALSE)
#> ℹ This example uses a special helper
id <- task_create_expr(runif(1), driver = FALSE)
# Status is only 'created', not 'submitted', as we did not submit
# task. This task can never run.
task_status(id)
#> [1] "created"
# Explicitly evaluate the task:
task_eval(id, verbose = TRUE)
#>
#> ── hipercow 1.0.36 running at '/tmp/Rtmpw3JKrD/file16dc4739deb1' ───────────────
#> ℹ library paths:
#> • /home/runner/work/_temp/Library
#> • /opt/R/4.4.1/lib/R/site-library
#> • /opt/R/4.4.1/lib/R/library
#> ℹ id: f9a49f3d88c73f013a61953d14bf80d1
#> ℹ starting at: 2024-10-08 15:27:13.989743
#> ℹ Task type: expression
#> • Expression: runif(1)
#> • Locals: (none)
#> • Environment: default
#> R_GC_MEM_GROW: 3
#> ───────────────────────────────────────────────────────────────── task logs ↓ ──
#>
#> ───────────────────────────────────────────────────────────────── task logs ↑ ──
#> ✔ status: success
#> ℹ finishing at: 2024-10-08 15:27:13.989743 (elapsed: 0.06753 secs)
task_result(id)
#> [1] 0.5144025
cleanup()
#> ℹ Cleaning up example