-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Checklist
- I added a descriptive title
- I searched for other feature requests and couldn't find a duplicate (including also the
type-feature
tag) - I confirmed that it's not related to another project area (see the above section)
What is the idea?
It would be nice if you could make pyscript code run in a worker.
Initially without DOM integration, but could add DOM integration via a proxy potentially...
Why is this needed
Personally I like this, because I could move all my testing scripts over to pyscript for things that are supposed to finally run in jupyterlite.
It would be nice generally though if pyscripts didn't hang the browser when doing long running tasks.
What should happen?
I envisage an attribute, so you could do e.g.
<py-script worker="true">
for c in range(1000):
do_something_slow()
</py-script>
without hanging the browser.
Alternatively, it could be a global option to make all pyodide on a page run in a single worker.
A super cool addition to this feature would be to make a proxy for the main thread js object, so it could still access DOM etc., although I think that probably requires either a) cross site isolation or b) stack switching proposal support to come into browsers, so that normal postmessage / comlink can be used for async calls.
Additional Context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status