client: sort out shutdown procedure and harmonize with socks5-client (#2695)

* common/task: rename ShutdownNotifier to TaskManager

* nym-client: return boxed error

* nym-client: enable graceful shutdown

* nym-client: task wait on shutdown to instead exit on closed channel

* Fix build

* Fix unused

* changelog: update
This commit is contained in:
Jon Häggblad
2022-12-14 17:13:00 +01:00
committed by GitHub
parent f6a79ce7c3
commit eb07ec8580
64 changed files with 325 additions and 277 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ use nym_api_requests::models::{MixNodeBondAnnotated, MixnodeStatus};
use rocket::fairing::AdHoc;
use std::collections::HashMap;
use std::{sync::Arc, time::Duration};
use task::ShutdownListener;
use task::TaskClient;
use tokio::sync::RwLockReadGuard;
use tokio::{
sync::{watch, RwLock},
@@ -174,7 +174,7 @@ impl NodeStatusCacheRefresher {
}
}
pub async fn run(&mut self, mut shutdown: ShutdownListener) {
pub async fn run(&mut self, mut shutdown: TaskClient) {
let mut fallback_interval = time::interval(self.fallback_caching_interval);
while !shutdown.is_shutdown() {
tokio::select! {