Can people show me code where they’re performing multiple IO actions in a single method chain and they think that’s *good*?
While I myself lean towards prefix await, postfix makes a lot of sense as well. If you think of "?" as "get or return Err", then "await" is similarly "get or return Pending". So "await" is to "Future" like "?" is to "Result". Since "?" is postfix, perhaps "await" should be too.
-
-
Yea but the costs are different between await and try. The analogy is true but that doesn’t mean we should do the same thing
-
True, just saying there is *some* appeal to postfix await. :) FWIW, my preference is "await expr" and "await? expr". Right now I'm browsing through async/await uses on GitHub, and it seems "let foo = await!(expr)?" is like 99% of cases. Chained awaits appear to be non-existent.
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.