Skip to contents

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.

Usage

task_eval(id, envir = .GlobalEnv, verbose = FALSE, root = NULL)

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.

Value

Logical indicating success (TRUE) or failure (FALSE)

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.34 running at '/tmp/RtmpUN1Cun/file194c4fcc4275' ───────────────
#>  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: 33189f19c5cedf39fbfe0ae9f2996af5
#>  starting at: 2024-08-16 20:23:00.470449
#>  Task type: expression
#>   • Expression: runif(1)
#>   • Locals: (none)
#>   • Environment: default
#>     R_GC_MEM_GROW: 3
#> ───────────────────────────────────────────────────────────────── task logs ↓ ──
#> 
#> ───────────────────────────────────────────────────────────────── task logs ↑ ──
#>  status: success
#>  finishing at: 2024-08-16 20:23:00.470449 (elapsed: 0.07334 secs)
task_result(id)
#> [1] 0.5144025

cleanup()
#>  Cleaning up example