convenience for ShutdownTracker (#6038)

This commit is contained in:
Simon Wicky
2025-09-16 10:50:52 +02:00
committed by GitHub
parent b6213bc016
commit 1286842c6d
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -33,6 +33,13 @@ impl ShutdownToken {
}
}
/// Creates a new ShutdownToken given a tokio `CancellationToken`.
pub fn new_from_tokio_token(cancellation_token: CancellationToken) -> Self {
ShutdownToken {
inner: cancellation_token,
}
}
/// Gets reference to the underlying [CancellationToken](tokio_util::sync::CancellationToken).
pub fn inner(&self) -> &CancellationToken {
&self.inner
+1 -1
View File
@@ -26,5 +26,5 @@ pub use nym_network_defaults::{
ChainDetails, DenomDetails, DenomDetailsOwned, NymContracts, NymNetworkDetails,
ValidatorDetails,
};
pub use nym_task::ShutdownToken;
pub use nym_task::{ShutdownToken, ShutdownTracker};
pub use nym_validator_client::UserAgent;