pub struct OutputRegistry { /* private fields */ }Expand description
Per-task broadcast registry.
One broadcast::Sender per TaskId, reused across all attempts of that task.
Lifecycle is owned by the supervisor (solti-core):
sink_foris called by the runner factory at the start of every attempt.announce_run_started/announce_run_finishedare called from the supervisor’s lifecycle transitions.evictremoves the channel when the task is fully terminal (Exhausted/Removed).
Implementations§
Source§impl OutputRegistry
impl OutputRegistry
Sourcepub fn ensure_channel(&self, task_id: TaskId)
pub fn ensure_channel(&self, task_id: TaskId)
Pre-create the broadcast channel for task_id without producing a
sink. Useful when a subscriber may race with the first runner attempt:
call ensure_channel at task-build time, then subscribe is safe to
invoke before the runner has started writing.
No-op if the channel already exists.
Sourcepub fn sink_for(&self, task_id: TaskId, attempt: u32) -> OutputSink
pub fn sink_for(&self, task_id: TaskId, attempt: u32) -> OutputSink
Get an OutputSink for (task_id, attempt). The first call for a
given task_id creates the broadcast channel; subsequent calls reuse
it (multi-run merge). The returned sink has fresh per-stream seq
counters scoped to this attempt.
Sourcepub fn subscribe(&self, task_id: &TaskId) -> Option<Receiver<OutputEvent>>
pub fn subscribe(&self, task_id: &TaskId) -> Option<Receiver<OutputEvent>>
Subscribe to a task’s output stream.
Sourcepub fn announce_run_started(&self, task_id: &TaskId, attempt: u32)
pub fn announce_run_started(&self, task_id: &TaskId, attempt: u32)
Push a OutputEvent::RunStarted into the channel.
No-op if no channel exists for this task.
Sourcepub fn announce_run_finished(
&self,
task_id: &TaskId,
attempt: u32,
exit_code: Option<i32>,
)
pub fn announce_run_finished( &self, task_id: &TaskId, attempt: u32, exit_code: Option<i32>, )
Push a OutputEvent::RunFinished into the channel.
No-op if no channel exists for this task.
Sourcepub fn active_channels(&self) -> usize
pub fn active_channels(&self) -> usize
Number of tasks with an active channel.