You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to migrate a existing JS app to yew, which process (potentially) large files with web workers on background.
If I understood it correctly, I should implement an Agent to do the work.
In the plain-old web-worker way, I pass the File object I got from form to the web worker, then read it with FileReader inside that worker. However, the File object does not implement Serialize/Deserialize, so I cannot pass it to Agent.
Is there a way to pass File object cross Agent? Or I have to read the content of file first, then pass the content to other Actor? Or, there is other way to offload CPU expensive tasks without relying on Actor?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm trying to migrate a existing JS app to yew, which process (potentially) large files with web workers on background.
If I understood it correctly, I should implement an
Agent
to do the work.In the plain-old web-worker way, I pass the
File
object I got from form to the web worker, then read it withFileReader
inside that worker. However, theFile
object does not implement Serialize/Deserialize, so I cannot pass it toAgent
.Is there a way to pass
File
object crossAgent
? Or I have to read the content of file first, then pass the content to other Actor? Or, there is other way to offload CPU expensive tasks without relying on Actor?Thanks.
Beta Was this translation helpful? Give feedback.
All reactions