Run one queued job (claim-next semantics) in the current R session.

tmuxRunNextWorker(
  queue_path,
  global_path,
  on_interrupt = c("requeue", "fail"),
  heartbeat_interval_s = 60,
  runNameLabel = quote(colnames(q)[1:2]),
  statusCalculate = getOption("spades.statusCalculate"),
  folderWithIterInFilename = getOption("spades.folderWithIterInFilename"),
  activeRunningPath = getOption("spades.activeRunningPath"),
  ss_id = NULL
)

Arguments

queue_path

character; path to the queue .rds

global_path

character; script to source for the job

on_interrupt

"requeue" or "fail". If the sourced script is interrupted, either requeue or mark as FAILED.

heartbeat_interval_s

numeric; seconds between heartbeats while the job runs

runNameLabel

A quoted expression (possibly of q, which is the result of q <- readRDS(queue_path)). Default is the first 2 column names of q. These will be concatenated and used as labels for various things including the activeRunningPath file(s).

statusCalculate

A quoted expression to compute job status from output files. Defaults to getOption("spades.statusCalculate", NULL).

folderWithIterInFilename

A quoted expression for a folder containing iteration info in filenames. Defaults to getOption("spades.folderWithIterInFilename", NULL).

activeRunningPath

Directory for "running" flag files. See tmuxActiveRunningPath.

ss_id

Optional Google Sheets/Drive ID for the shared queue. When supplied workers use the GS backend instead of the local RDS file.

Value

"ok" | "interrupt" | "empty" (if no pending work found); used by tmuxRunWorkerLoop()