You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Proxying] Update proxying with callback to support cancellation (#18776)
Completely overhaul the interface for proxying with callbacks:
- Rename `emscripten_proxy_async_with_callback` to the simpler
`emscripten_proxy_callback`.
- Add an optional `cancel` callback argument that will be scheduled on the
proxying thread if the worker thread dies before the work is started. A
future PR will change this so that the `cancel` callback will be called if a
worker thread dies before the work is finished to be more consistent with the
`proxy_sync` APIs.
- Remove the ability to receive the result of the proxied function as an
argument to the callback function since the extra expressiveness was not
general enough to warrant the added complexity.
- Use only a single context argument rather than a separate context for the
proxied function and the callback. This is just as expressive, but it is
simpler avoids the question of what context object should be passed to the
cancellation callback.
Also update the only user of the callback API, dynlink.c, to use the new API. A
future PR will implement a promise-based proxying API and update dynlink.c to
use that instead, so this PR just tries to make the minimal necessary changes to
dynlink.c.
0 commit comments