3 ms·
> Data in/out of the worker is string only[0] I don't think this is correct. You can pass lots of types in via postMessage(), including Objects, ArrayBuffers,
by markdog12 5y ago
> Data in/out of the worker is string only[0]
I don't think this is correct. You can pass lots of types in via postMessage(), including Objects, ArrayBuffers, even a Canvas context. Some objects are transferrable as well, that is, zero copy.
As far as your point about still being stuck on the main thread, that may indeed be the case depending on the work.
More info:
https://stackoverflow.com/questions/19152772/how-to-pass-large-data-to-web-workers https://stackoverflow.com/questions/19152772/how-to-pass-lar...