File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,8 @@ You will see something like this:
161161That shows that the C code only continued to execute after the async JS
162162completed.
163163
164+ .. _marking_async_functions :
165+
164166Marking JS library functions as async
165167#####################################
166168
Original file line number Diff line number Diff line change @@ -59,8 +59,11 @@ can also be used directly for more precise control over how work is run on
5959different threads.
6060
6161When a JS library function is marked as both ``__proxy: 'sync' `` and ``__async:
62- 'auto' `` the calling thread will block until the async operation on the
63- main thread is completed (i.e. the returned promise is resolved). This allows
62+ 'auto' ``, it is expected to return a promise
63+ (see :ref: `marking_async_functions `).
64+ The calling thread will block until the async operation on the
65+ main thread is completed (i.e. the returned promise is resolved), and the value
66+ that the promise resolves to will be returned to the caller. This allows
6467functions that would require :ref: `ASYNCIFY ` (when called from the main browser
6568thread) to be called without :ref: `ASYNCIFY ` from a background thread. In other
6669words, background threads can block on proxied work even without :ref: `ASYNCIFY `
You can’t perform that action at this time.
0 commit comments