Hacker News new | ask | show | jobs
by xfer 3222 days ago
You can do DoXxx() using DoXxxAsync() by calling wait() on the future it returns. No duplicated code necessary.
1 comments

It's nice that that'll work but it's... kinda gross. Can it call wait() automatically via some auto type conversion? Ideally in a synchronous context it would call wait(), and in an async context it would automatically annotate await (and you could always override by calling wait() manually).