The state machine in C# with async/await
You often here that the async
/await
keywords leads to a state machine. But what does that mean? Let's discuss this with a simple example.
You often here that the async
/await
keywords leads to a state machine. But what does that mean? Let's discuss this with a simple example.
Did you ever hear about "Structured Concurrency"? If not, this article is for you. We will discover what it is, why it is useful, and what it could look like in C#.
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.