Skip to content

Commit

Permalink
Merge pull request #174 from rustaceanrob/block-10-27
Browse files Browse the repository at this point in the history
feat: shutdown in blocking context
  • Loading branch information
rustaceanrob authored Oct 27, 2024
2 parents b483f7c + c5fa616 commit 1b14e6c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ macro_rules! impl_core_client {
.map_err(|_| ClientError::SendError)
}

/// Tell the node to shut down from a synchronus context.
///
/// # Errors
///
/// If the node has already stopped running.
pub async fn shutdown_blocking(&self) -> Result<(), ClientError> {
self.ntx
.blocking_send(ClientMessage::Shutdown)
.map_err(|_| ClientError::SendError)
}

/// Broadcast a new transaction to the network.
///
/// # Errors
Expand Down

0 comments on commit 1b14e6c

Please sign in to comment.