observer(queue_name, redis_host = "127.0.0.1", redis_port = 6379, config = NULL)
Creates an observer for an rrqueue. This is the "base class" for
a couple of different objects in rrqueue; notably the
queue
object. So any method listed here also works
within queue
objects.
Most of the methods of the observer
object are extremely
simple and involve fetching information from the database about
the state of tasks, environments and workers.
The method and argument names try to give hints about the sort of
things they expect; a method asking for task_id
expects a
single task identifier, while those asking for task_ids
expect a vector of task identifiers (and if they have a default
NULL
then will default to returning information for
all task identifiers). Similarly, a method starting
task_
applies to one task while a method starting
tasks_
applies to multiple.
tasks_list
Usage:
tasks_list()
Value: A character vector
tasks_status
Usage:
tasks_status(task_ids = NULL, follow_redirect = FALSE)
Arguments:
task_ids
follow_redirect
Value: A named character vector; the names will be the task ids, and the values are the status of each task. Possible status values are
PENDING
RUNNING
COMPLETE
ERROR
ORPHAN
REDIRECT
MISSING
tasks_overview
Usage:
tasks_overview()
tasks_times
Usage:
tasks_times(task_ids = NULL, unit_elapsed = "secs")
Arguments:
task_ids
unit_elapsed
difftime
so the units there are available and are "auto", "secs", "mins", "hours", "days", "weeks".
Value:
A data.frame
, one row per task, with columns
submitted
started
NA
if waitingfinished
NA
if waiting or runningwaiting
running
NA
if waitingidle
NA
if waiting or runningThe row names of the data.frame will be the task ids.
tasks_envir
Usage:
tasks_envir(task_ids = NULL)
Arguments:
task_ids
Value: A named character vector; names are the task ids and the value is the environment id associated with that task.
task_get
task
object associated with a given task identifier. This can be used to interrogate an individual task. See the help for task
objects for more about these objects.
Usage:
task_get(task_id = )
Arguments:
task_id
task_result
Usage:
task_result(task_id = , follow_redirect = FALSE, sanitise = FALSE)
Arguments:
task_id
follow_redirect
sanitise
UnfetchabmeTask
object rather than throwing an error.
tasks_groups_list
tasks_set_group
method of link{queue}
.
Usage:
tasks_groups_list()
tasks_in_groups
Usage:
tasks_in_groups(groups = )
Arguments:
groups
tasks_groups_list
to get a list of valid groups).
tasks_lookup_group
Usage:
tasks_lookup_group(task_ids = NULL)
Arguments:
task_ids
Value:
A named character vector; names refer to task ids and the value is the group (or NA
if no group is set for that task id).
task_bundle_get
task_bundle
Usage:
task_bundle_get(groups = NULL, task_ids = NULL)
Arguments:
groups
task_ids
task_ids
here, only one of groups
or task_ids
can be provided, so if task_ids=NULL
then task_ids
is ignored and groups
is used.
envirs_list
Usage:
envirs_list()
envirs_contents
Usage:
envirs_contents(envir_ids = NULL)
Arguments:
envir_ids
Value: A list, each element of which is a list of elements
packages
sources
source_files
envir_workers
Usage:
envir_workers(envir_id = , worker_ids = NULL)
Arguments:
envir_id
worker_ids
Value:
A named logical vector; TRUE
if a worker can use an environment, named by the worker identifers.
workers_len
Usage:
workers_len()
workers_list
Usage:
workers_list()
workers_list_exited
Usage:
workers_list_exited()
workers_status
Usage:
workers_status(worker_ids = NULL)
Arguments:
worker_ids
Value: A named character vector; the names will be the task ids, and the values are the status of each task. Possible status values are
IDLE
BUSY
LOST
workers_times
RedisHeartbeat
package.
Usage:
workers_times(worker_ids = NULL, unit_elapsed = "secs")
Arguments:
worker_ids
unit_elapsed
difftime
so the units there are available and are "auto", "secs", "mins", "hours", "days", "weeks".
Value:
A data.frame
, one row per worker, with columns
worker_id
expire_max
expire
last_seen
last_action
workers_log_tail
Usage:
workers_log_tail(worker_ids = NULL, n = 1)
Arguments:
worker_ids
n
0
or Inf
to return all entries.
Value:
A data.frame
with columns
worker_id
time
command
message
workers_info
INFO
command. This is registered at startup and after recieving a INFO
message from a queue
object. So the information may be out of date.
Usage:
workers_info(worker_ids = NULL)
Arguments:
worker_ids
Value:
A list, each element of which is a worker_info
worker_envir
workers_info
that might be out of date.
Usage:
worker_envir(worker_id = )
Arguments:
worker_id