with --wait polls once a second inside one command. Two cheaper primitives: wait <path>... [--timeout s] exits 0 the moment every path is free (or expired) without taking anything, so a caller can sequence its own claim; and watch streams one JSON line per change in the store (claimed, released, expired, swept, acquired) by polling for-each-ref and diffing, so an orchestrator can react instead of poll. Both are pure bash. Stretch: watch --path <p> filters.
with --waitpolls once a second inside one command. Two cheaper primitives:wait <path>... [--timeout s]exits 0 the moment every path is free (or expired) without taking anything, so a caller can sequence its own claim; andwatchstreams one JSON line per change in the store (claimed, released, expired, swept, acquired) by pollingfor-each-refand diffing, so an orchestrator can react instead of poll. Both are pure bash. Stretch:watch --path <p>filters.