Understanding JavaScript Async by Hacking Dropbox
<p>When most online articles explain javascript async behaviour, most immediately gravitate towards the concepts of <em>delayed evaluation</em>, <code>Promise</code>s, and <code>async function</code>s. While this does offer value to the pragmatic programmer, it fails to explain just how a single-threaded programming language deals with immediacy and delayed execution. In fact, I only recently had the opportunity to truly delve in to how <em>most</em> JavaScript runtimes execute asynchronous behaviour.</p> <p>(Not all JavaScript implementations deal with asynchronous behaviour the same way; this becomes important with how we expect our code to e...</p>
When most online articles explain javascript async behaviour, most immediately gravitate towards the concepts of delayed evaluation, Promise
s, and async function
s. While this does offer value to the pragmatic programmer, it fails to explain just how a single-threaded programming language deals with immediacy and delayed execution. In fact, I only recently had the opportunity to truly delve in to how most JavaScript runtimes execute asynchronous behaviour.
(Not all JavaScript implementations deal with asynchronous behaviour the same way; this becomes important with how we expect our code to e...