Open
Description
Currently there is a perceived inconsistency between APIs like emscripten_sleep
and emscripten_fetch
: while both perform sort of an async I/O, one of them works with Asyncify, while another works only by compiling code in a separate thread.
Technically, there is no reason for this discrepancy, and it should be possible to allow APIs like emscripten_fetch
with just Asyncify if user wants it to run on the main thread instead of a separate one.
Perhaps this is a more general issue though and there should be some shared mechanism for all such APIs to choose between Asyncify and thread-based blocking depending on compile flags?