Re:Rust Starter Kit 2020
by wngr on Saturday October 03, 2020 @08:00PM
(#24675627)
While I agree with your sentiment, and do the same, `select!` is not more than looping through a couple of `try_recv` calls. So in the spirit of the author, a few lines of boilerplate vs a new dependency.
[ Parent
| on HN ]
Re:Rust Starter Kit 2020
by Matthias247 on Saturday October 03, 2020 @10:42PM
(#24676174)
> `select!` is not more than looping through a couple of `try_recv` calls.
That's wrong. Any `try_recv` call will not make the thread park until one of the expected action happened. You can implement a busy loop which calls `try_recv()` - but this is by far not as efficient as what `select` does.