diff --git a/bastion/src/children.rs b/bastion/src/children.rs index 14836eba..23faa917 100644 --- a/bastion/src/children.rs +++ b/bastion/src/children.rs @@ -350,6 +350,10 @@ impl Children { async fn run(mut self) -> Self { loop { + for (_, launched) in self.launched.values_mut() { + let _ = poll!(launched); + } + match poll!(&mut self.bcast.next()) { // TODO: Err if started == true? Poll::Ready(Some(BastionMessage::Start)) => { @@ -382,11 +386,7 @@ impl Children { return self; } - Poll::Pending => (), - } - - for (_, launched) in self.launched.values_mut() { - let _ = poll!(launched); + Poll::Pending => pending!(), } } } diff --git a/bastion/src/supervisor.rs b/bastion/src/supervisor.rs index 86e41d7f..9be70f71 100644 --- a/bastion/src/supervisor.rs +++ b/bastion/src/supervisor.rs @@ -562,7 +562,8 @@ impl Supervisor { } let launched = supervised.launch(); - self.launched.insert(id, (order, launched)); + self.launched.insert(id.clone(), (order, launched)); + self.order[order] = id; } SupervisionStrategy::OneForAll => { // TODO: stop or kill?