Task is the original and most well known API, since it shipped with the TPL, but it means that an object allocation is necessary even for scenarios where it turns out that it was already available, i.e. awaiter.IsCompleted returned true. The ValueTask value-type (struct) acts as a hybrid result that can represent an already completed result without allocating or an incomplete pending operation.

Bharat Dwarkani shared on Aug 30, 2019
image
blog.marcgravell.com
bookmarks
share
favorite_border0 visibility13
favorite_border0 visibility13 share bookmarks
add