3 ms·
> What about async/await? > It seems to be a safe pattern under the criteria stated in the article as long as all async calls are awaited. Which means it's no
by masklinn 4y ago
> What about async/await?
> It seems to be a safe pattern under the criteria stated in the article as long as all async calls are awaited.
Which means it's not unless that awaiting is mandatory in all cases.
Which it is not because pretty much all such systems have a `spawn`-type construct (when it's not the plain default as it is in Javascript, or C# IIRC) which just forks off an independent task. Your `await` acts as a `join`, but that's still just a join, which is optional, and which most systems have (except go, because goroutines don't have handles).
The argument of structured concurrency is the binding of mandatory joining (or awaiting) to the lexical scope, in the way structured flow bound jumps to lexical scopes.