expose cancelled

This commit is contained in:
Jędrzej Stuczyński
2025-09-18 10:57:01 +01:00
parent 7f4ef7f772
commit 351acb7875
@@ -25,6 +25,7 @@ use std::sync::Arc;
use std::task::{Context, Poll};
use tokio::sync::RwLockReadGuard;
use tokio_util::sync::CancellationToken;
use tokio_util::sync::WaitForCancellationFutureOwned;
/// Client connected to the Nym mixnet.
pub struct MixnetClient {
@@ -273,6 +274,12 @@ impl MixnetClient {
}
}
}
pub fn cancelled(&self) -> WaitForCancellationFutureOwned {
self.shutdown_handle
.clone_shutdown_token()
.cancelled_owned()
}
}
#[derive(Clone)]