expose cancelled
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user