~/talk

Synchronously Call Your Asynchronous Functions!

Talkat BeJS Conf 2023 · 2023-05-11..05-12· [web-platform, javascript]
slides:none on file

Babel migrates to ESM so dynamic import forces async plugin loading, but synchronous APIs like babel-register and the parser must keep working; solution uses Node worker threads with a SharedArrayBuffer, Atomics.wait/notify and MessageChannel: main thread blocks on Atomics.wait, worker does async work, serializes result or error back, Atomics.notify wakes the main thread, which returns the value. Production requires try/catch everywhere and notify in finally. Works in Node (recent Node internals use it), not usable on the browser main thread.

AI-written summary · about

  1. 0:00Introduction
  2. 1:02Why sync async functions
  3. 2:52Worker threads and atomics
  4. 6:41Error handling in threads
  5. 8:30Browser limitations
  6. 9:12Real-world use cases
  7. 10:14Conclusion and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.