How to execute code in create_local_resource
on a different thread other than main?
#2572
Replies: 2 comments 1 reply
-
P.S. I did do some performance recording via DevTools, and it does seem to run on the main thread. So the actual question is how can I get around this limitation |
Beta Was this translation helpful? Give feedback.
0 replies
-
All code running in the browser, async or not, runs on a single thread, unless you use a Web Worker to spawn an additional thread. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a setup where user can pick an image on their local machine and I run some image processing algorithms on the picked image on client side. I achieve this by having a signal for the picked image, and a local resource that is reactive based on this signal.
The process I'm running within this resource fetcher is a long running one (Takes about 21s), and my website seems to lock up completely while it's running. Does the code inside
create_local_resource
actually run on the main thread despite beingasync
, or could there be some other issue?Would using spawn_local be a good solution here? Or does that run on the main thread too?
Beta Was this translation helpful? Give feedback.
All reactions