diff --git a/runtime/src/task.rs b/runtime/src/task.rs index 81973e23..756f592b 100644 --- a/runtime/src/task.rs +++ b/runtime/src/task.rs @@ -89,11 +89,16 @@ impl Task { where T: 'static, { - let select_all = stream::select_all( - tasks.into_iter().filter_map(|task| task.stream), - ); + let mut select_all = stream::SelectAll::new(); + let mut units = 0; - let units = select_all.len(); + for task in tasks.into_iter() { + if let Some(stream) = task.stream { + select_all.push(stream); + } + + units += task.units; + } Self { stream: Some(boxed_stream(select_all)),