News for hackers. Stuff that matters.
Re:Asynchronous Programming in C# by zmj on Friday September 24, 2021 @03:51PM (#28647016)
I've run into this in code that completes synchronously in the common case, but falls back to an async implementation - think caching. The simple way to write this creates a state machine even on the synchronous path.

It's possible to work around this efficiently by pulling the async code into a separate method and using ValueTask for the outer method return type.

There are no comments on this comment yet.