Description Usage Arguments Details Methods
Create a task handle object. This is a "pointer" to a task and
can be used to retrieve information about status, running times,
expression and the result of the task once complete. Generally
you do not need to make a task object as they will be created for
you by things like the task_get method of the
observer and queue objects.
1 |
obj |
A |
task_id |
Task identifier |
key_complete |
If known, specify the |
Tasks have a unique identifier; these are unique within a queue and are implemented as an incrementing integer. However, this is an implementation detail and should not be relied on. The identifier is represented as a character string rather than an integer in most places.
Tasks exist in one of a number of statuses. See the
status method below for a list of possible statuses and
their interpretation.
statusReturns a scalar character indicating the task status.
Usage:
status(follow_redirect = FALSE)
Arguments:
follow_redirectshould we follow redirects to get the status of any requeued task?
Value: Scalar character. Possible values are
PENDINGqueued, but not run by a worker
RUNNINGbeing run on a worker, but not complete
COMPLETEtask completed successfully
ERRORtask completed with an error
ORPHANtask orphaned due to loss of worker
REDIRECTorphaned task has been redirected
MISSINGtask not known (deleted, or never existed)
resultFetch the result of a task, so long as it has completed.
Usage:
result(follow_redirect = FALSE)
Arguments:
follow_redirectshould we follow redirects to get the status of any requeued task?
waitLike result, but will wait until the task is complete. In order to preserve the key_complete for anything that might be listening for it (and to avoid collision with anything else writing to that key), this function repeatedly polls the database. Over a slow connection you may want to increase the every parameter.
Usage:
wait(timeout, every = 0.05)
Arguments:
timeoutLength of time, in seconds, to wait. A value of zero will not wait. Infinite times are possible and can be escaped by pressing Ctrl-C or Escape (depending on platform).
everyHow often, in seconds, to poll for results
exprreturns the expression stored in the task
Usage:
expr(locals = FALSE)
Arguments:
localsLogical, indicating if the local variables associated with the expression should also be retuned. If TRUE, then local variables used in the expression will be returned in a attribute of the expression envir.
Value:
A quoted expression (a language object). Turn this into a string with deparse. If locals was TRUE there will be an environment attribute with local variables included.
envirreturns the environment identifier for the task
Usage:
envir()
timesreturns a summar of times associated with this task.
Usage:
times(unit_elapsed = "secs")
Arguments:
unit_elapsedUnit to use in computing elapsed times. The default is to use "secs". This is passed through to difftime so the units there are available and are "auto", "secs", "mins", "hours", "days", "weeks".
Value:
A one row data.frame with columns
submittedTime the task was submitted
startedTime the task was started, or NA if waiting
finishedTime the task was completed, or NA
if waiting or running
waitingElapsed time spent waiting
runningElapsed time spent running, or NA if waiting
idleElapsed time since finished, or NA
if waiting or running
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.