Skip to main content

Module task_executor

Module task_executor 

Source
Expand description

Async task executor with incremental output streaming.

TaskExecutor bridges crate::task_registry::TaskRegistry and the OS process layer. When the registry marks a task as running, the caller invokes TaskExecutor::spawn to start the actual process asynchronously.

§Output fan-out

Raw output bytes are broadcast on a tokio::sync::broadcast channel so that multiple independent consumers (future: log storage, diagnostic parser, UI render) can each subscribe without blocking one another. Use TaskExecutor::subscribe to obtain a receiver.

§Cancellation

The CancellationToken stored in each crate::task_registry::Task is monitored inside the spawned async task. When it fires, the child process is killed and the task is reported back as TaskStatus::Cancelled.

§Integration

The executor sends Operation::TaskFinished (or Operation::TaskStarted) back to the main event loop via the op_tx channel so that apply_operation can call crate::task_registry::TaskRegistry::mark_finished on the main thread and keep the registry consistent.

Structs§

ParsedOutputEvent
A parsed, styled output event produced after running bytes through TerminalParser.
TaskExecutor
Spawns tasks as OS processes and streams their output over a broadcast channel.
TaskOutputEvent
A raw byte chunk read from a task’s stdout or stderr.

Enums§

OutputStream
Which stdio stream an output chunk originated from.
TaskEvent
High-level event broadcast to all subscribers.