Background task manager #332

Merged
lx merged 35 commits from background-task-manager into main 2022-07-08 11:30:32 +00:00
Showing only changes of commit 708dab6e0f - Show all commits

View file

@ -193,7 +193,7 @@ impl WorkerHandler {
WorkerStatus::Idle => { WorkerStatus::Idle => {
if *self.stop_signal.borrow() { if *self.stop_signal.borrow() {
select! { select! {
new_st = self.worker.wait_for_work(&mut self.stop_signal_worker) => { new_st = self.worker.wait_for_work(&self.stop_signal_worker) => {
self.status = new_st; self.status = new_st;
} }
_ = tokio::time::sleep(Duration::from_secs(1)) => { _ = tokio::time::sleep(Duration::from_secs(1)) => {
@ -202,7 +202,7 @@ impl WorkerHandler {
} }
} else { } else {
select! { select! {
new_st = self.worker.wait_for_work(&mut self.stop_signal_worker) => { new_st = self.worker.wait_for_work(&self.stop_signal_worker) => {
self.status = new_st; self.status = new_st;
} }
_ = self.stop_signal.changed() => { _ = self.stop_signal.changed() => {