Chenged return type of `spawn_from_sync()` to be an iterator of `Result<Option<i32>>` so the caller can decide what to do if the child terminates without an exit code. Also changed to `eyre::Result<>` to report the specific failure and child process" index.
.with_note(||"The child may have detached itself")
.with_section(idx)?
.code())
},
},
Err(err)=>{
Err(err)=>{
if_trace!(error!("Failed to spawn child: {err}"));
if_trace!(error!("Failed to spawn child: {err}"));
Err(err)
Err(err)
.wrap_err("Failed to spawn child")
}
}
}
}.with_section(idx)
})
})
//todo!("Map `spawn_from(...)` and wait for each child to terminate concurrently. Then return an iterator or the return codes or spawning errors for that now terminated child.")
//todo!("Map `spawn_from(...)` and wait for each child to terminate concurrently. Then return an iterator or the return codes or spawning errors for that now terminated child.")