Skip to content

Commit

Permalink
Updated Broadcast polling to indicate that Poll::Ready(None) won't ha…
Browse files Browse the repository at this point in the history
…ppen.
  • Loading branch information
r3v2d0g committed Nov 12, 2019
1 parent e39cc3a commit 5b66bff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
20 changes: 8 additions & 12 deletions bastion/src/children.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,10 @@ impl Children {
return self;
}
}
Poll::Ready(None) => {
// TODO: stop or kill?
self.kill().await;
self.faulted();

return self;
}
// NOTE: because `Broadcast` always holds both a `Sender` and
// `Receiver` of the same channel, this would only be
// possible if the channel was closed, which never happens.
Poll::Ready(None) => unreachable!(),
Poll::Pending => pending!(),
}
}
Expand Down Expand Up @@ -841,11 +838,10 @@ impl Child {

continue;
}
Poll::Ready(None) => {
self.faulted();

return;
}
// NOTE: because `Broadcast` always holds both a `Sender` and
// `Receiver` of the same channel, this would only be
// possible if the channel was closed, which never happens.
Poll::Ready(None) => unreachable!(),
Poll::Pending => (),
}

Expand Down
11 changes: 4 additions & 7 deletions bastion/src/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,13 +869,10 @@ impl Supervisor {
return self;
}
}
Poll::Ready(None) => {
// TODO: stop or kill?
self.kill(0..).await;
self.faulted();

return self;
}
// NOTE: because `Broadcast` always holds both a `Sender` and
// `Receiver` of the same channel, this would only be
// possible if the channel was closed, which never happens.
Poll::Ready(None) => unreachable!(),
Poll::Pending => pending!(),
}
}
Expand Down
6 changes: 4 additions & 2 deletions bastion/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,10 @@ impl System {
return;
}
}
// FIXME
Poll::Ready(None) => unimplemented!(),
// NOTE: because `Broadcast` always holds both a `Sender` and
// `Receiver` of the same channel, this would only be
// possible if the channel was closed, which never happens.
Poll::Ready(None) => unreachable!(),
Poll::Pending => pending!(),
}
}
Expand Down

0 comments on commit 5b66bff

Please sign in to comment.