Run queued jobs repeatedly (pane-local loop).

tmuxRunWorkerLoop(
  queue_path,
  global_path,
  on_interrupt = c("requeue", "fail"),
  heartbeat_interval_s = 60,
  stop_file = NULL,
  activeRunningPath = getOption("spades.activeRunningPath"),
  runNameLabel = quote(colnames(q)[1:2]),
  ss_id = NULL,
  pane_mode = c("reuse", "killAndNewPane"),
  email = getOption("gargle_oauth_email"),
  cache_path = getOption("gargle_oauth_cache"),
  dots_path = 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

stop_file

optional path; if present, stop after current iteration

activeRunningPath

Directory for "running" flag files. See tmuxActiveRunningPath.

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).

ss_id

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

pane_mode

Character. "reuse" (default) loops inside the same R session. "killAndNewPane" runs one job, spawns a fresh replacement pane, retiles the tmux window, then kills the current pane – freeing all R memory between jobs.

email

gargle OAuth email; forwarded to replacement panes in killAndNewPane mode.

cache_path

gargle OAuth cache path; forwarded to replacement panes.

dots_path

Path to .tmux_dots.rds holding extra ... args; forwarded to replacement panes so they can reload complex objects before sourcing.

Value

invisibly TRUE