task(obj, task_id, key_complete = NULL)
queue
or observer
object.key_complete
,
otherwise we look it up on creation.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.
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.
status
Usage:
status(follow_redirect = FALSE)
Arguments:
follow_redirect
Value: Scalar character. Possible values are
PENDING
RUNNING
COMPLETE
ERROR
ORPHAN
REDIRECT
MISSING
result
Usage:
result(follow_redirect = FALSE, sanitise = FALSE)
Arguments:
follow_redirect
sanitise
If the task is not yet complete or is missing, return an UnfetchabmeTask
object rather than throwing an error.
wait
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:
timeout
every
expr
Usage:
expr(locals = FALSE)
Arguments:
locals
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.
envir
Usage:
envir()
times
Usage:
times(unit_elapsed = "secs")
Arguments:
unit_elapsed
difftime
so the units there are available and are "auto", "secs", "mins", "hours", "days", "weeks".
Value:
A one row data.frame
with columns
submitted
started
NA
if waitingfinished
NA
if waiting or runningwaiting
running
NA
if waitingidle
NA
if waiting or running