runziggurat / xrpl

Ziggurat x XRPL
0 stars 3 forks source link

feat(node): introduce wait_until_exit API #126

Closed Rqnsom closed 1 year ago

Rqnsom commented 1 year ago

wait_until_exit API A non-blocking function which periodically checks the node's status code.

Bonus info: Once the async Drop trait support is introduced in Rust, we can remove the loop and use a non-blocking tokio::process::Command and then call a tokio version of wait() function on it.

Because, calling wait() on std::process::Command will block the entire tokio runtime and the whole test process will be stopped until the node is actually killed - which is bad if we have other tokio threads running.

So looping with a non-blocking try_wait() is the alternative solution.