Skip to content

Commit 0570a96

Browse files
committed
Add is_running function to Node
1 parent db1b7dc commit 0570a96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,11 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
708708
Ok(())
709709
}
710710

711+
/// Checks if [`Node`] runtime is available.
712+
pub fn is_running(&self) -> bool {
713+
self.runtime.read().unwrap().is_some()
714+
}
715+
711716
/// Disconnects all peers, stops all running background tasks, and shuts down [`Node`].
712717
///
713718
/// After this returns most API methods will return [`Error::NotRunning`].

0 commit comments

Comments
 (0)