Use meaningful names for select! variables

This commit is contained in:
teor 2021-04-14 10:16:47 +10:00 committed by Deirdre Connolly
parent e8e6d292c5
commit a417c7c8c7
2 changed files with 6 additions and 4 deletions

View File

@ -353,8 +353,10 @@ where
);
let crawler_action = tokio::select! {
a = handshakes.next() => a.expect("handshakes never terminates, because it contains a future that never resolves"),
a = crawl_timer.next() => a.expect("timers never terminate"),
next_handshake_res = handshakes.next() => next_handshake_res.expect(
"handshakes never terminates, because it contains a future that never resolves"
),
next_timer = crawl_timer.next() => next_timer.expect("timers never terminate"),
// turn the demand into an action, based on the crawler's current state
_ = demand_rx.next() => {
if handshakes.len() > 50 {

View File

@ -73,9 +73,9 @@ mod imp {
// If both signals are received, select! chooses one of them at random.
tokio::select! {
// SIGINT - Terminal interrupt signal. Typically generated by shells in response to Ctrl-C.
() = sig(SignalKind::interrupt(), "SIGINT") => {}
_ = sig(SignalKind::interrupt(), "SIGINT") => {}
// SIGTERM - Standard shutdown signal used by process launchers.
() = sig(SignalKind::terminate(), "SIGTERM") => {}
_ = sig(SignalKind::terminate(), "SIGTERM") => {}
};
}