-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace async-std with ZRuntime and tokio #937
Conversation
src/scouting.rs
Outdated
@@ -209,7 +209,8 @@ pub extern "C" fn z_scout( | |||
}) | |||
.await | |||
.unwrap(); | |||
async_std::task::sleep(std::time::Duration::from_millis(timeout)).await; | |||
|
|||
tokio::time::sleep(std::time::Duration::from_millis(timeout)).await; | |||
std::mem::drop(scout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to explicitly drop scout here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. Even though it's not meant to be in scope of this PR, I can remove it as part of it if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it is better to remove unneeded code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, and I've also improve error handling by removing a dangerous unwrap
.
* Fix clippy warnings * run apt-get update for Cross compile on ubuntu-latest (#938) * build: Sync with eclipse-zenoh/zenoh@f421407 from 2025-03-03 (#934) Co-authored-by: eclipse-zenoh-bot <[email protected]> * cargo fmt * Replace async-std with ZRuntime and tokio (#937) * Replace async-std with ZRuntime and tokio * Improve error handling in z_scout * Fix clippy warnings * cargo fmt --------- Co-authored-by: DenisBiryukov91 <[email protected]> Co-authored-by: eclipse-zenoh-bot <[email protected]> Co-authored-by: eclipse-zenoh-bot <[email protected]>
Zenoh moved to
tokio
already for a quite some time.async-std
dependency was still in use in thez_scout
implementation. This PR removesasync-std
dependencies and usesZRuntime
andtokio
instead.