In this post I discuss the new Task.WaitAsync() APIs introduced in .NET 6, how you can use them to "cancel" an await call, and how they can replace other approaches you may be using currently.The new Task.WaitAsync API in .NET 6 In a recent post, I described how to use a TaskCompletionSource with IHostApplicationLifetime as a way of "pausing" a background service until the application starts up. In that code I used the following function that waits for a TaskCompletionSource.Task to complete, but also s...
Strona głównaSztuka programowania
Sztuka programowania 952 dni, 18 godzin, 48 minut temu 142 pokaż kod licznika zwiń