5 useful extensions for Task<T> in .NET
In this short blog post, I will show you 5 useful extensions for Task
In this short blog post, I will show you 5 useful extensions for Task
You might have code where an object offers you an event to notify you when a specific operation is done. But event's can be tricky to use, especially when you want to have a continuous flow in your application.
That is where TaskCompletionSource
comes into play. We can "transform" an event based function into something which is await-able from the outside world via the await
keyword.
Since .NET Core 2.0 the Type ValueTask
. It seems that there is a lot of overlap between Task
and ValueTask
.
So let's have a deeper look into ValueTask
. Where should we use it and how should we use it properly? And also: where we should not use is.
This short post will give an overview how to cancel all remaining tasks once Task.WhenAny
finishes. Plus how Task.WhenAny
behaves in different circumstances.