Skip to main content

CommandRunRepository

Trait CommandRunRepository 

Source
pub trait CommandRunRepository {
    // Required methods
    fn insert_command_run(&self, run: &NewCommandRun) -> Result<()>;
    fn update_command_run(&self, run: &NewCommandRun) -> Result<()>;
    fn update_command_run_with_events(
        &self,
        run: &NewCommandRun,
        events: &[DbEventRecord],
    ) -> Result<()>;
    fn persist_phase_result_with_events(
        &self,
        run: &NewCommandRun,
        events: &[DbEventRecord],
    ) -> Result<()>;
    fn update_command_run_pid(&self, run_id: &str, pid: i64) -> Result<()>;
    fn list_task_log_runs(
        &self,
        task_id: &str,
        limit: usize,
    ) -> Result<Vec<TaskLogRunRow>>;
    fn find_active_child_pids(&self, task_id: &str) -> Result<Vec<i64>>;
    fn find_inflight_command_runs_for_task(
        &self,
        task_id: &str,
    ) -> Result<Vec<InflightRunRecord>>;
    fn find_completed_runs_for_pending_items(
        &self,
        task_id: &str,
    ) -> Result<Vec<CompletedRunRecord>>;
}
Expand description

Command run recording and process tracking.

Required Methods§

Source

fn insert_command_run(&self, run: &NewCommandRun) -> Result<()>

Inserts a command-run record.

Source

fn update_command_run(&self, run: &NewCommandRun) -> Result<()>

Updates an existing command-run record.

Source

fn update_command_run_with_events( &self, run: &NewCommandRun, events: &[DbEventRecord], ) -> Result<()>

Updates a command run and appends events in a single repository call.

Source

fn persist_phase_result_with_events( &self, run: &NewCommandRun, events: &[DbEventRecord], ) -> Result<()>

Persists a completed phase result together with its emitted events.

Source

fn update_command_run_pid(&self, run_id: &str, pid: i64) -> Result<()>

Updates the operating-system PID associated with a running command.

Source

fn list_task_log_runs( &self, task_id: &str, limit: usize, ) -> Result<Vec<TaskLogRunRow>>

Lists recent command runs for log streaming or inspection.

Source

fn find_active_child_pids(&self, task_id: &str) -> Result<Vec<i64>>

Returns active child PIDs for a task.

Source

fn find_inflight_command_runs_for_task( &self, task_id: &str, ) -> Result<Vec<InflightRunRecord>>

Returns in-flight command runs for a task (FR-038).

Source

fn find_completed_runs_for_pending_items( &self, task_id: &str, ) -> Result<Vec<CompletedRunRecord>>

Returns completed runs whose parent items are still pending (FR-038).

Implementors§