feat: improved UX for parallel graph execution

This commit is contained in:
2026-05-20 18:54:20 -06:00
parent 3c7d19da07
commit 81c037515e
12 changed files with 82 additions and 140 deletions
+20
View File
@@ -17,7 +17,11 @@ pub async fn render_stream(
rx: UnboundedReceiver<SseEvent>,
app: &AppConfig,
abort_signal: AbortSignal,
silent: bool,
) -> Result<()> {
if silent {
return drain_silently(rx, &abort_signal).await;
}
let ret = if *IS_STDOUT_TERMINAL && app.highlight {
let render_options = app.render_options()?;
let mut render = MarkdownRender::init(render_options)?;
@@ -28,6 +32,22 @@ pub async fn render_stream(
ret.map_err(|err| err.context("Failed to reader stream"))
}
async fn drain_silently(
mut rx: UnboundedReceiver<SseEvent>,
abort_signal: &AbortSignal,
) -> Result<()> {
loop {
if abort_signal.aborted() {
break;
}
match rx.recv().await {
Some(SseEvent::Done) | None => break,
Some(SseEvent::Text(_)) => {}
}
}
Ok(())
}
pub fn render_error(err: anyhow::Error) {
eprintln!("{}", error_text(&pretty_error(&err)));
}