summaryrefslogtreecommitdiff
path: root/makima/src/daemon/cli/supervisor.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-23 19:49:58 +0000
committerGitHub <noreply@github.com>2026-01-23 19:49:58 +0000
commitf6f0790217d4098ffb6d2b3df08b0cf83ff61727 (patch)
tree234287f703364a314b0fa2438a29750e27e67c81 /makima/src/daemon/cli/supervisor.rs
parent5595a2fce2e426fd9f1b6224df467a2300f06238 (diff)
downloadsoryu-f6f0790217d4098ffb6d2b3df08b0cf83ff61727.tar.gz
soryu-f6f0790217d4098ffb6d2b3df08b0cf83ff61727.zip
feat: Add client-side polling for CLI wait command (#23)
* [WIP] Heartbeat checkpoint - 2026-01-23 03:34:44 UTC * feat: Add client-side polling for CLI wait command When contracts wait for tasks in makima, the CLI now polls and returns once the task has changed state. This provides resilient task status detection even if: - Server's broadcast channels miss a notification - Network connections are intermittent - Long-polling HTTP requests timeout at load balancers The implementation uses a hybrid approach: 1. First tries server-side wait with short timeout (30s) 2. Falls back to polling via supervisor_get_task endpoint 3. Configurable poll_interval (default 5s) via --poll-interval flag Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/src/daemon/cli/supervisor.rs')
-rw-r--r--makima/src/daemon/cli/supervisor.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/makima/src/daemon/cli/supervisor.rs b/makima/src/daemon/cli/supervisor.rs
index 7e17135..3bc8525 100644
--- a/makima/src/daemon/cli/supervisor.rs
+++ b/makima/src/daemon/cli/supervisor.rs
@@ -60,9 +60,13 @@ pub struct WaitArgs {
#[arg(index = 1)]
pub task_id: Uuid,
- /// Timeout in seconds
+ /// Timeout in seconds (total wait time)
#[arg(index = 2, default_value = "300")]
pub timeout: i32,
+
+ /// Polling interval in seconds (how often to check task status via client-side polling)
+ #[arg(long, default_value = "5")]
+ pub poll_interval: u64,
}
/// Arguments for read-file command.