Get the status of a task. See Details for the lifecycle.
Details
A task passes through a lifecycle:
created
submitted
running
success
,failure
,cancelled
These occur in increasing order and the result of this function is the furthest through this list.
Later, we will introduce other types to cope with tasks that are blocked on dependencies (or have become impossible due to failed dependencies).
Examples
cleanup <- hipercow_example_helper()
#> ℹ This example uses a special helper
ids <- c(task_create_expr(runif(1)), task_create_expr(runif(1)))
#> ✔ Submitted task 'b6729c73eb4cd05c8973fe59a2530cab' using 'example'
#> ✔ Submitted task '6a921c6f4ab1ee7d32bf060b6f6a99bd' using 'example'
# Depending on how fast these tasks get picked up they will be one
# of 'submitted', 'running' or 'success':
task_status(ids)
#> [1] "submitted" "submitted"
# Wait until both tasks are complete
task_wait(ids[[1]])
#> [1] TRUE
task_wait(ids[[2]])
#> [1] TRUE
# And both are success now
task_status(ids)
#> [1] "success" "success"
cleanup()
#> ℹ Cleaning up example