9 ms·
> What is "await" if not a synonym for "suspend"?!? The `await` keyword in most languages is not a synonym for suspending thread execution so much as it is an
by AdieuToLogic 5d ago
> What is "await" if not a synonym for "suspend"?!?
The `await` keyword in most languages is not a synonym for suspending thread execution so much as it is an effectual attempt to replicate the functionality of `coreturn`[0]. To wit, if an underlying `Future`/`Promise` has completed before the `await` instruction is evaluated, the thread executing same will not be suspended.
0 - https://www.euclideanspace.com/maths/discrete/category/higher/monad/comonad/index.htm https://www.euclideanspace.com/maths/discrete/category/highe...