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

fix (webapp): make sure that Pyodide doesn't affect responsiveness. #23

Open
hwelsters opened this issue Dec 4, 2023 · 0 comments
Open
Labels
bug Something isn't working
Milestone

Comments

@hwelsters
Copy link
Owner

hwelsters commented Dec 4, 2023

Is your feature request related to a problem? Please describe.
Infinite loops currently cause the entire website to freeze.
For example, the following snippet of code:
image

Describe the solution you'd like
There are a few options:

  • Implement some way of making sure that the code times out after a certain period of time.
    This could be by using some built-in function in Pyodide itself.
    If we find some way to do it using Javascript as well, I would be fine with the solution.
  • Run Pyodide in a webworker so that slow Python code will not affect the website's responsiveness. (This solution is definitely preferrable since the user won't have to wait for 5 seconds or whatever the timeout time is.)

Directions
In terms of where to start, pyodide-provider.tsx is where Pyodide is loaded and where there are functions to run Python code.
https://pyodide.org/en/stable/usage/webworker.html

@hwelsters hwelsters added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Dec 4, 2023
@hwelsters hwelsters changed the title feat (webapp): make sure that Pyodide code times out after a certain period of time fix (webapp): make sure that Pyodide code times out after a certain period of time Dec 6, 2023
@hwelsters hwelsters added this to the 0.2.0 milestone Dec 26, 2023
@hwelsters hwelsters changed the title fix (webapp): make sure that Pyodide code times out after a certain period of time fix (webapp): make sure that Pyodide doesn't affect responsiveness. Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant