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

Use of async_std::task::sleep instead of tokio::time::sleep in examples #2912

Merged
merged 4 commits into from
Sep 3, 2024

Conversation

ASR-ASU
Copy link
Contributor

@ASR-ASU ASR-ASU commented Sep 1, 2024

Proposal for #2908 issue. Replacing tokio allows the following examples to run on wasm platforms:

  • backgrounded_futures
  • clock
  • control_focus
  • eval
  • future
  • signals
  • streams

What about the documentation?

@ASR-ASU ASR-ASU changed the title Use of tokio::time::sleep instead of async_std::task::sleep in examples Use of async_std::task::sleep instead of tokio::time::sleep in examples Sep 1, 2024
Copy link
Member

@ealmloff ealmloff left a comment

Choose a reason for hiding this comment

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

Thank you! I switched to just always using web_time in the clock example. It will fall back to std on any non-wasm platform

@ealmloff ealmloff enabled auto-merge (squash) September 3, 2024 14:06
@ealmloff
Copy link
Member

ealmloff commented Sep 3, 2024

What about the documentation?

We should modify the documentation in the same way. If the code snippets we use can be cross platform, that would be better

@ealmloff ealmloff added example Update examples tweak Small changes to improve experience labels Sep 3, 2024
@ealmloff ealmloff merged commit 1dfa1b5 into DioxusLabs:main Sep 3, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Update examples tweak Small changes to improve experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants