Closed felipellrocha closed 2 years ago
You can use the global()
function of js_sys
to get the global object, and then dyn_into
that into a DedicatedWorkerGlobalScope
(see this issue discussing the problem). Note that, due to the way things are currently instrumented, you won't be able to post messages to the worker since the messaging API is already utilized by wasm_thread
. Some additional code would need to be added in this crate to allow for posting custom messages.
Closing this, because it's a problem with web_sys
. Posting messages to workers is tracked in #9
Once I'm inside of a thread, how do I get that thread's
DedicatedWorkerGlobalScope
?