- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Document what parts of Tokio can be used without its runtime #4232
Comments
Anything in Regarding having Tokio work on web-assembly, it's somewhat unclear what that would even mean. In wasm, you don't actually have a traditional runtime, as the actual runtime is your browser. |
Thanks, that helps a lot. From a user perspective Tokio's executor supporting WebAssembly would mean that things like |
We are open to expanding WASM support beyond the executor independent pieces if we can find a good way to do it. I don't know enough about WASM to know what it would take, and I do not have the bandwidth to drive the feature myself. I don't think a method like |
Maybe I will have a look myself what can be done since I will require some decent async support for a project. What is the case against |
I opened #4240 to elaborate on the channels. Maybe you can get |
Would the tokio maintainers consider spinning the I have a situation where I would love to be able to use the various tokio channel implementations but don't actually need the tokio runtime. My understanding (...which I admit could be wrong...) is that a crate is a single unit of compilation, so depending on tokio channels requires compiling all of tokio, even if I don't need anything from tokio besides channels. Having channels in their own crate could be a very nice compilation time win for users in my situation. |
Tokio used to be split into many crates like that. We undid it because it causes significant maintenance burden. Also, even though As for the compile time, Tokio has feature flags that let you disable things you don't need. By only enabling |
Thanks for pointing out that the |
Is your feature request related to a problem? Please describe.
I'd like to use functionality from Tokio without using its runtime, particularly I'd like to use functionality from
tokio::sync
(channels, locks),tokio::io
(traits and utils without stdio) andtokio::time
with an executor targeting WebAssembly.Describe the solution you'd like
It is currently not documented if these modules require using the Tokio runtime or if they can be used with any async runtime.
I'd like to see official documentation whether that use case is supported.
Describe alternatives you've considered
I could try and experiment, but I would like a statement from the developers what is supported officially.
Alternatively it would be great if Tokio could provide a runtime that works on WebAssembly, even when limited at first, e.g. single threaded. I am not asking for WebAssembly support for
tokio::net
ortokio::fs
, only a runtime that supports Tokio's synchronization primitives and allows building WebSocket support (browser provided) on top of it.The text was updated successfully, but these errors were encountered: