Skip to content
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

Tokio support #591

Closed
NathanSWard opened this issue Nov 15, 2023 · 6 comments · Fixed by #566
Closed

Tokio support #591

NathanSWard opened this issue Nov 15, 2023 · 6 comments · Fixed by #566
Assignees
Labels
enhancement Existing things could work better release Part of the next release

Comments

@NathanSWard
Copy link

Describe the feature

It's unfortunate in the Rust ecosystem that we have multiple different async runtime w/ different APIs.
However, tokio is by far the most popular, widely used, and tested runtime compared to async_std, smol, etc...

It appears that Zenoh has locked itself currently into using async_std which will likely prevent adoption from Rust devs who have already chosen tokio and don't wish to introduce a new runtime just for Zenoh.

At my company we are considering using Zenoh for our robot fleet communication - however, we already have a majority of our code supporting tokio and needing to shoehorn async_std will likely prove more difficult than the benefits we will be receiving.

Is it possible to add support for tokio? Ideally this would be behind a feature flag so devs could choose which runtime they want, but not supporting tokio seems like a huge mistake when it comes to adoption of Zenoh.

@YuanYuYuan
Copy link
Contributor

Hi @NathanSWard! It's on our plan. We're surviving the change of asynchronous runtime to tokio in this pull request.

@NathanSWard
Copy link
Author

Awesome, this is great to hear @YuanYuYuan !
If this needs any assistance - please let me know how I could help!

@marvin-hansen
Copy link
Contributor

marvin-hansen commented Dec 14, 2023

Fully support this feature.

I had to freeze zenoh adoption for my company because it does not support tokio yet. However, that would change the moment Tokio support is available as I am not exactly content with the alternative.

As far as I understand the async situation, you can configure the async runtime behind feature flag and then users decides which one they want to use. See this project for example, that already supports both, std-asynd and tokio

https://github.com/zeromq/zmq.rs/blob/master/Cargo.toml

Also, I would be willing to do some testing.

@YuanYuYuan
Copy link
Contributor

Hi @marvin-hansen, thanks for your information! Supporting both runtimes wouldn't be our priority for the time being. The runtime switch problem in Zenoh library is from async-global-executor to Tokio runtime. Although it's able to change async runtime on async-global-executor (like the zmq.rs does but more), we found that the Tokio one still relies on async-std. We want to avoid this since async-std has been stale for a while.

Furthermore, we have a refactor on async usage in our code base while porting to Tokio. The idea is different from the current async-global-executor version. In the next release, our goal is to keep the performance, have more runtime controllability, and embrace the Tokio ecosystem.

@marvin-hansen
Copy link
Contributor

Thanks,

That has settled the case.

Eventually I've switched my messaging to Fluvio because it fully supports Tokio and is production ready.

https://www.fluvio.io

It seems to me that this project has quite a bit of groundwork to do before becoming viable.

Nevermind.

@Mallets Mallets linked a pull request Jan 25, 2024 that will close this issue
19 tasks
@Mallets Mallets added release Part of the next release enhancement Existing things could work better labels Jan 25, 2024
@Mallets Mallets moved this to In progress in Zenoh 1.0.0 release Jan 25, 2024
@YuanYuYuan
Copy link
Contributor

Has been completed via #830 and #566.
@Mallets do you mind closing this issue and changing its status to Done?

@Mallets Mallets moved this from In progress to Done in Zenoh 1.0.0 release Mar 19, 2024
@Mallets Mallets closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Existing things could work better release Part of the next release
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants