Skip to contents

run, poll, step, read, and finalize tessiflow jobs

Usage

job_maybe_start(flow_name, job_name)

job_start(flow_name, job_name)

job_step(flow_name, job_name)

job_on_error(flow_name, job_name, error)

job_poll(flow_name, job_name)

job_read(flow_name, job_name, timeout = 1)

job_finalize(flow_name, job_name)

job_reset(flow_name, job_name)

Arguments

flow_name

string workflow name

job_name

string job name

error

error condition object

timeout

milliseconds to wait for read before giving up, passed to processx::process$poll_io

Value

invisibly

invisibly

character vector of output from process. Names are one or more of output, error and process and match the names from processx::poll_io

Functions

  • job_maybe_start(): check to see if it's time to start a job and call the job runner if it is.

    the job will be started if following conditions are all true:

    • runs-on must match the computer name as listed in Sys.info()["nodename"]

    • if must be true in the current context

    • needs must have finished running since the last time this ran (with return value = 0 unless if evaluates to true)

    • the most recent run in scheduled_runs is after the last actual run time for this job

  • job_start(): run the job in a callr process

  • job_step(): Run the next step in a job

  • job_on_error(): Updates flows table and database, writes to log, and finalizes running session on error

  • job_poll(): poll the process stdout and stderr streams and call job_step when ready.

  • job_read(): Read stdout and stderr from the process and write to log. When ready, call job_step

  • job_finalize(): Closes R session, writes to log, console and database, and updates retval.

  • job_reset(): Resets job for next run, updates flows table but NOT database, writes to log