Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions di/torq/bin/torqx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,11 @@ foreachtarget() {
usage() {
cat >&2 <<USAGE
usage: torqx.sh {start|stop|restart|status|attach|export-systemd} [procname|all] [--tmux] [extra torqx_init.q args]
start [procname|all] [--tmux|-t] [-norun ...] start one or all process.csv rows (all skips
start [procname|all] [--tmux] [-norun ...] start one or all process.csv rows (all skips
rows whose optional startwithall column is 0)
--tmux/-t: run in attachable tmux sessions (dev mode)
--tmux: run in attachable tmux sessions (dev mode)
instead of background nohup+logfile
other flags, e.g. q's -t timer, are passed to the process
stop [procname|all] stop one or all (also cleans up any tmux session)
restart [procname|all] [--tmux] ... stop then start
status [procname|all] show up/down (tags tmux-managed procs), no args means all
Expand Down Expand Up @@ -341,13 +342,13 @@ case "$cmd" in
devattach) cmd="attach" ;;
esac

# pre-scan the remaining args: pull out the --tmux/-t flag (which may appear anywhere) so it is
# pre-scan the remaining args: pull out the --tmux flag (which may appear anywhere) so it is
# NOT forwarded to torqx_init.q, and collect the rest as the positional target + passthrough args.
target=""
args=()
for a in "$@"; do
case "$a" in
--tmux|-t) TMUX_MODE=1 ;;
--tmux) TMUX_MODE=1 ;;
*)
if [ -z "$target" ] && [ "${a#-}" = "$a" ]; then
target="$a" # first non-flag token is the target (procname|all)
Expand Down
5 changes: 3 additions & 2 deletions di/torq/torq.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ for. See `di.torq.config`'s own docs for the 5-tier cascade itself.

It also adds `timerms`: q's own `-t` in milliseconds, or null without `-t`. q consumes `-t`, so
`cmdlinet` reads it from the full command line `.z.X`, once. The tickerplants batch on it, as TorQ's
`.z.ts` runs at `-t`, without reading the command line themselves.
`.z.ts` runs at `-t`, without reading the command line themselves. `torqx.sh` passes it through after
the target: `torqx.sh start stp1 -t 1000`.

### Dependency building

Expand Down Expand Up @@ -328,7 +329,7 @@ stays exclusively `di.torq`'s job). An optional `startwithall` column, as in Tor
### Dev mode (tmux)

`torqx.sh start` normally launches each process as a background `nohup` process
redirecting to a logfile. Passing `--tmux` (or `-t`) instead runs each process inside a
redirecting to a logfile. Passing `--tmux` instead runs each process inside a
detached, **attachable tmux session** - one session per process, named
`<TORQXSTACKID>-<procname>` (e.g. `torqx-poc-rdb1`) - so a developer can attach to a
live `q)` console for any process:
Expand Down