Function
resend_stdio
(
task_id: TaskId,
channel: ChannelId,
stdio: Option<impl tokio::io::AsyncRead + Unpin>,
stream: StreamSender,
)
Source from the content-addressed store, hash-verified
| 213 | } |
| 214 | |
| 215 | async fn resend_stdio( |
| 216 | task_id: TaskId, |
| 217 | channel: ChannelId, |
| 218 | stdio: Option<impl tokio::io::AsyncRead + Unpin>, |
| 219 | stream: StreamSender, |
| 220 | ) -> tako::Result<()> { |
| 221 | if let Some(mut stdio) = stdio { |
| 222 | log::debug!("Resending stream {task_id}/{channel}"); |
| 223 | loop { |
| 224 | let mut buffer = vec![0; STDIO_BUFFER_SIZE]; |
| 225 | let size = stdio.read(&mut buffer[..]).await?; |
| 226 | buffer.truncate(size); |
| 227 | stream.send_data(channel, buffer).await?; |
| 228 | if size == 0 { |
| 229 | break; |
| 230 | }; |
| 231 | } |
| 232 | } |
| 233 | Ok(()) |
| 234 | } |
| 235 | |
| 236 | fn create_directory_if_needed(file: &StdioDef) -> std::io::Result<()> { |
| 237 | if let StdioDef::File { path, .. } = file |
Callers
nothing calls this directly
Tested by
no test coverage detected