mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-04-28 06:21:23 +00:00
fix: loop -> tokio::select! in pwsp-daemon main loop for less CPU usage
This commit is contained in:
+3
-8
@@ -56,17 +56,12 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
player_loop().await;
|
||||
});
|
||||
|
||||
loop {
|
||||
if commands_loop_handle.is_finished() {
|
||||
tokio::select! {
|
||||
_ = commands_loop_handle => {
|
||||
eprint!("Commands loop was finished, stopping program...");
|
||||
player_loop_handle.abort();
|
||||
break;
|
||||
}
|
||||
|
||||
if player_loop_handle.is_finished() {
|
||||
_ = player_loop_handle => {
|
||||
eprint!("Audio Player loop was finished, stopping program...");
|
||||
commands_loop_handle.abort();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user