rrq_task_result | R Documentation |
Get the result for a single task (see rrq_task_results for a method for efficiently getting multiple results at once). Returns the value of running the task if it is complete, and an error otherwise.
rrq_task_result(task_id, error = FALSE, follow = NULL, controller = NULL)
task_id |
The single id for which the result is wanted. |
error |
Logical, indicating if we should throw an error if a
task was not successful. By default ( |
follow |
Optional logical, indicating if we should follow any
redirects set up by doing rrq_task_retry. If not given, falls
back on the value passed into the controller, the global option
|
controller |
The controller to use. If not given (or |
The result of your task. This may be an error (an object
with class rrq_task_error
) if your task has failed.
obj <- rrq_controller("rrq:example")
# Create a task, wait for it to finish and fetch its result
t <- rrq_task_create_expr(runif(1), controller = obj)
rrq_task_wait(t, controller = obj)
rrq_task_result(t, controller = obj)
# Tasks that fail do not fail on result, but instead return an
# object with the class "rrq_task_error"
t <- rrq_task_create_expr(readRDS("somefile.rds"), controller = obj)
rrq_task_wait(t, controller = obj)
rrq_task_result(t, controller = obj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.