Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed children group's running loop and supervisors' order list #72

Merged
merged 1 commit into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions bastion/src/children.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) => {
Expand Down Expand Up @@ -382,11 +386,7 @@ impl Children {

return self;
}
Poll::Pending => (),
}

for (_, launched) in self.launched.values_mut() {
let _ = poll!(launched);
Poll::Pending => pending!(),
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion bastion/src/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down