If set is empty don't select on it
This commit is contained in:
parent
e701ea0e56
commit
e9456945d9
1 changed files with 20 additions and 0 deletions
|
@ -357,8 +357,26 @@ where
|
||||||
break 'outer;
|
break 'outer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if set.is_empty() {
|
||||||
|
if let Some(res) = m.next().await {
|
||||||
|
match res {
|
||||||
|
Ok(field) => {
|
||||||
|
set.spawn_local(handle_stream_field(field, Rc::clone(&form)));
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
error = Some(e.into());
|
||||||
|
continue 'outer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stream_finished = true;
|
||||||
|
continue 'outer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
opt = m.next() => {
|
opt = m.next() => {
|
||||||
|
tracing::trace!("Selected stream");
|
||||||
if let Some(res) = opt {
|
if let Some(res) = opt {
|
||||||
match res {
|
match res {
|
||||||
Ok(field) => {
|
Ok(field) => {
|
||||||
|
@ -371,9 +389,11 @@ where
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stream_finished = true;
|
stream_finished = true;
|
||||||
|
continue 'outer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
opt = set.join_next() => {
|
opt = set.join_next() => {
|
||||||
|
tracing::trace!("Selected set");
|
||||||
if let Some(res) = opt {
|
if let Some(res) = opt {
|
||||||
let (name_parts, content) = match res {
|
let (name_parts, content) = match res {
|
||||||
Ok(Ok(Ok(tup))) => tup,
|
Ok(Ok(Ok(tup))) => tup,
|
||||||
|
|
Loading…
Reference in a new issue