this post was submitted on 18 Sep 2023
7 points (73.3% liked)
Rust Programming
8150 readers
16 users here now
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It depends. Sometimes you can just put an exit call at the end of
main
to kill the thread. If you want to attempt graceful shutdown then usually I just use a booleanshutdown
flag. Then the loop becomeswhile !shutdown.get() {