Skip to content

Commit 1b9863e

Browse files
committed
expose cancelled
1 parent 75280eb commit 1b9863e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sdk/rust/nym-sdk/src/mixnet/native_client.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use std::pin::Pin;
2424
use std::sync::Arc;
2525
use std::task::{Context, Poll};
2626
use tokio::sync::RwLockReadGuard;
27+
use tokio_util::sync::WaitForCancellationFutureOwned;
2728

2829
/// Client connected to the Nym mixnet.
2930
pub struct MixnetClient {
@@ -267,6 +268,12 @@ impl MixnetClient {
267268
}
268269
}
269270
}
271+
272+
pub fn cancelled(&self) -> WaitForCancellationFutureOwned {
273+
self.shutdown_handle
274+
.clone_shutdown_token()
275+
.cancelled_owned()
276+
}
270277
}
271278

272279
#[derive(Clone)]

0 commit comments

Comments
 (0)