Example showing how to process a web_sys::File in web workers #480
Unanswered
LucaCappelletti94
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
All web workers made available in gloo worker require for the arguments to be serializable and
web_sys::File
does not implement eitherserde::Serialize
orserde::Deserialize
.It seems to me that files can only be processed in the web worker after having been fully loaded and the bincode serialized and submitted, which may block the page execution. This should not be the case as, apparently, in javascript there is a
Worker.postMessage
that can accept a File object, and this method is available in the web-sys bindings here:post_message
. So, how do I process a File with a web worker?Beta Was this translation helpful? Give feedback.
All reactions