Expand description
Live log streaming infrastructure for real-time step output.
During workflow execution, shell commands and agent invocations produce output incrementally. This module provides a channel-based mechanism to stream those lines to an external consumer (e.g. the worker’s log pusher) so that SSE clients can display output in real time.
§Architecture
ShellExecutor ──► StepLogSender ──► LogSender (mpsc) ──► LogPusher ──► API
AgentExecutor ─┘ (worker)The LogSender is an unbounded MPSC channel sender. The
StepLogSender wraps it with step metadata (run ID, step ID, step name)
so that executors can emit lines with a simple emit(stream, line) call.
§Examples
use ironflow_engine::log_sender::{self, StepLogSender};
use ironflow_engine::notify::LogStream;
use uuid::Uuid;
let (sender, mut receiver) = log_sender::channel();
let step_sender = StepLogSender::new(
sender,
Uuid::now_v7(),
Uuid::now_v7(),
"build".to_string(),
);
step_sender.emit(LogStream::Stdout, "Compiling ironflow v0.1.0");
let line = receiver.try_recv().unwrap();
assert_eq!(line.line, "Compiling ironflow v0.1.0");
assert_eq!(&*line.step_name, "build");Structs§
- LogLine
- A single log line emitted during step execution.
- Step
LogSender - Step-scoped log sender with pre-filled metadata.
Functions§
- channel
- Create a new log streaming channel.
Type Aliases§
- LogReceiver
- Receiver half of the log streaming channel.
- LogSender
- Sender half of the log streaming channel.