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

Documentation: Improve WASM support documentation #6835

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

9SMTM6
Copy link

@9SMTM6 9SMTM6 commented Sep 10, 2024

  • don't mention a failure realizing as panic, as it might instead show as a browser runtime error, depending on the environment
  • Make a statement about what is to be expected, and what is considered a bug (this will have to de discussed, whether its acceptable)
  • Mention a few common usecases with what works and what does not. Its not complete at all, I dont have time to test every usecase, people can always extend it with their own PRs

Also see #5667.

* don't mention a failure realizing as panic, as it might instead show as a browser runtime error, depending on the environment
* Make a statement about what is to be expected, and what is considered a bug (this will have to de discussed, whether its acceptable)
* Mention a few common usecases with what works and what does not. Its not complete at all, I dont have time to test every usecase, people can always extend it with their own PRs
@Darksonn Darksonn added T-docs Topic: documentation A-tokio Area: The main tokio crate M-runtime Module: tokio/runtime T-wasm Topic: Web Assembly labels Sep 11, 2024
Comment on lines -437 to 443
//! Note also that if the runtime becomes indefinitely idle, it will panic
//! immediately instead of blocking forever. On platforms that don't support
//! Note also that if the runtime becomes indefinitely idle, that will lead to errors
//! instead of blocking forever. On platforms that don't support
//! time, this means that the runtime can never be idle in any way.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I'm concerned, this paragraph explains why your use of LocalSet worked, and your use of the runtime directly failed. In one case, you caused a situation where the application would block forever. With LocalSet, your code did not trigger such a situation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I understand this, LocalSet doesn't block ever, only the runtimes may?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds like you executed the LocalSet using a different runtime from Tokio. In that case, the difference is due to use of that other runtime.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I'm just not neccessarily aware of what parts of Tokio do what precisely.

And yeah, in that case I guess I use LocalSet similar to what FuturesUnordered would do. However I can use it without managing a reference to that object myself, and potentially with other niceties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-runtime Module: tokio/runtime T-docs Topic: documentation T-wasm Topic: Web Assembly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants