My blog
wpbindt.github.io·8w

2024-01-21

TL;DR: async/await-style concurrency forces you to be explicit about which code does I/O. That’s a good thing.

Introduction

In this post I go over one aspect of async/await-style concurrency that is frequently cited as a drawback, and show that it’s actually big benefit (in my opinion even one of the main benefits). In short, async/await forces you to be explicit about I/O by requiring you to use the async and await keywords. I also discuss my main gripe with async/await, which is that it’s easy to accidentally block the event loop.

Red code, blue code

There is a classic blog post by Bob Nystrom explaining why he prefers (for example) Go’s concurrency model over …

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help