convenience for ShutdownTracker (#6038)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user