Hello!

I'm hoping someone has already run into this before and can tell me what 
I'm doing wrong...

I have a JavaScript function I'm calling from a C++ multi-threaded game 
that is designed to perform an async HTTP fetch.

I'm building the game using USE_PTHREADS=1 and PROXY_TO_PTHREAD=1 and I've 
tried both having the JavaScript function embedded in a EM_JS() and in a 
--js-library.  The C++ code sparks off a pthread and calls into the 
JavaScript function, and that JavaScript code executes and then returns 
back to the C++ code.  What doesn't work is any of the Promise / await 
code, nothing is executing in those code blocks.

I've tried calling emscripten_thread_sleep() from the C++ code, which is 
still executing in the thread waiting on the JavaScript asynchronous code 
to call it back, it just never happens.  The network request is just marked 
as "(pending)" in Chrome and never changes.

So my question is, what's the right way to run Promise/async/await code in 
a WebAssembly pthread/Web Worker?

Thank you!!

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/aecd43c5-6662-4d7d-bb8c-15461e75522e%40googlegroups.com.

Reply via email to