scheduler: make Scheduler stateless

Scheduler has no Stopped state anymore. If Scheduler exists, it is
always started. Scheduler is stopped via Scheduler.stop(), which
consumes Scheduler and cannot fail.
This commit is contained in:
link2xt
2022-05-07 12:52:42 +00:00
parent 7bcb03f1ec
commit 60d3960f3a
6 changed files with 113 additions and 168 deletions

View File

@@ -60,7 +60,7 @@ impl Context {
use futures::future::FutureExt;
ensure!(
!self.scheduler.read().await.is_running(),
self.scheduler.read().await.is_none(),
"cannot configure, already running"
);
ensure!(