orderly_runner_ | R Documentation |
Object for managing running jobs on the redis queue
Object for managing running jobs on the redis queue
root
Orderly root
config
Orderly config
allow_ref
Allow git to change branch/ref for run
default_branch
Default git branch
con
Redis connection
cleanup_on_exit
If TRUE workers are killed on exit
queue
The redis queue
queue_id
Redis queue ID
keys
Set of redis keys for mapping between key, report_id and task_id
new()
Create object, read configuration and setup redis connection.
orderly_runner_$new( root, identity, queue_id, workers, cleanup_on_exit = workers > 0, worker_timeout = Inf )
root
Orderly root.
identity
Remote identity, as listed in orderly_config.yml
queue_id
ID of an existing queue to connect to, creates a new one if NULL.
workers
Number of workers to spawn.
cleanup_on_exit
If TRUE workers are killed on exit.
worker_timeout
How long worker should live for before it is killed. Expect this is only finite during local testing.
start_workers()
Start n workers for this queue and optionally set a timeout.
orderly_runner_$start_workers(workers, timeout)
workers
Number of workers to spawn.
timeout
How long worker should live for before it is killed. Expect this is only finite during local testing.
TRUE, called for side effects.
assert_ref_switching_allowed()
Check if ref switching is allowed in this runner. Errors if ref is non NULL and ref switching disallowed, otherwise does nothing.
orderly_runner_$assert_ref_switching_allowed(ref)
ref
Input ref to check
TRUE, called for side effects.
submit_task_report()
Queue a job to run an orderly report.
orderly_runner_$submit_task_report( name, parameters = NULL, ref = NULL, instance = NULL, changelog = NULL, poll = 0.1, timeout = 60 * 60 * 3, depends_on = NULL )
name
Name of report to be queued.
parameters
List of parameters to pass to report.
ref
The git sha to run the report.
instance
The db instance for the report to pull data from.
changelog
Description of changes to the report.
poll
How frequently to poll for the report ID being available.
timeout
Timeout for the report run default 3 hours.
depends_on
Keys of any tasks which this report depends on
The key for the job, note this is not the task id. The task id can be retrieved from redis using the key.
submit()
Submit an arbitrary job on the queue
orderly_runner_$submit(expr, depends_on = NULL)
expr
A quoted R expression.
depends_on
Task ids for any dependencies of this job.
Task id
submit_workflow()
Queue a workflow.
orderly_runner_$submit_workflow( reports, ref = NULL, changelog = NULL, poll = 0.1, timeout = 60 * 60 * 3 )
reports
Details of reports to be run.
ref
The git sha to run the workflow.
changelog
Description of changes to the reports - applied to all reports.
poll
How frequently to poll for the report ID being available. Applied to each of the reports run in the workflow
timeout
Timeout for each of the reports run as part of the workflow default 3 hours.
The key for the workflow and each individual report
status()
Get the status of a job
orderly_runner_$status(key, output = FALSE)
key
The job key.
output
If TRUE include the output from job running.
List containing the key, status, report_id (if available), output and the position of the job in the queue.
workflow_status()
Get the status of a workflow.
orderly_runner_$workflow_status(workflow_key, output = FALSE)
workflow_key
The workflow key.
output
If TRUE include the output from each job in the workflow.
List containing the workflow_key, status and status of each job in the workflow.
queue_status()
Get the running and queued tasks in front of key in the queue.
If key
is NULL then includes all queued tasks.
orderly_runner_$queue_status(key = NULL)
key
The job key, if NULL returns all queued tasks.
List containing the key, status and report name of any running tasks and any queued tasks in front of key in the queue.
check_timeout()
Check if any running tasks have passed their timeouts. This is run by the API on a preroute - we check for timeouts everytime someone interacts with the API. Not intended to be run directly.
orderly_runner_$check_timeout()
List of killed reports.
kill()
Kill a job
orderly_runner_$kill(key)
key
The job key.
destroy()
Destroy the queue. Not expected to be called directly, used in tests.
orderly_runner_$destroy()
cleanup()
Cleanup workers and destroy the queue. Not expected to be called directly, gets registered as finaliser of the object.
orderly_runner_$cleanup()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.