dotnetomaniak.pl - Artykuły z tagiem async/await

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...

Tagi: async/await
Źródło: andrewlock.net
Dziel się z innymi:
Cancelling await calls in .NET 6 with Task.WaitAsync()

Sztuka programowania 756 dni, 22 godziny, 30 minut temu Piotr Stapp 139 źrodło rozwiń

On this page: If you've been following this blog and my Twitter feed, you know I've been going through a lengthy process of updating the Markdown Monster WPF desktop application from using an WebBrowser control based editor and preview interface to using the new WebView2 control. This new control provides a modern browser that use the Chromium engine which provides much better compatibility with modern Web Standards than the old Internet Explorer based WebBrowser control. The new control has strict r...

Tagi: async/await
Dziel się z innymi:
Thoughts on Async/Await Conversion in a Desktop App - Rick Strahl's Web Log

Sztuka programowania 1019 dni, 23 godziny, 54 minuty temu Piotr Stapp 30 źrodło rozwiń

In the last two posts, I’ve described 14 different code smells related to the async/await keywords. Beside the problem description, I’ve also provided info about code analyzers that can detect and report given issue. Those analyzers come from a few different packages that are not strictly devoted to the asynchronous programming area. They also contain rules from other fields with predefined severity, which might not be appropriate to your needs, or you might not be interested in enforcing them at all. Th...

Dziel się z innymi:
Async code smells and how to track them down with analyzers - Summary · Cezary Piątek Blog

Narzędzia 1269 dni, 21 godzin, 54 minuty temu cezarypiatek 78 źrodło rozwiń

Which analyzer package should I use and how to configure it to avoid most common problems related to async/await.

Dziel się z innymi:
Async code smells and how to track them down with analyzers - Part I · Cezary Piątek Blog

Sztuka programowania 1292 dni, 23 godziny, 3 minuty temu cezarypiatek 67 źrodło rozwiń

Asynchroniczny C# : ThreadPool, IAsyncResult, Task API i Async

Dziel się z innymi:
Asynchroniczny C# : ThreadPool, IAsyncResult, Task API i Async

Sztuka programowania 1367 dni, 23 godziny, 4 minuty temu krzysiekb 193 źrodło rozwiń

P. RoguszewskiLeave a comment Hey Guys! As You maybe know from C# 8, every class with implement interface IAsyncDisposable can be disposed of with clause await using. It’s looks pretty, modern, even very good IDE like Rider show tips Use await using what harm could there be? The answer is everything. In my case, it was a situation related to very popular ORM library EntityFramework Core, version for PostgreSQL (efcore.pg). I have some background services, lovely timers, which every X time send SQL dat...

Źródło: the-worst.dev
Dziel się z innymi:
Not always, IDE tip and modern functions works very well - await using EntityFramework story. - The-worst.dev

Sztuka programowania 1375 dni, 23 godziny, 56 minut temu proguszewski 61 źrodło rozwiń

It is said that picture is worth a thousand words, and I agree. That’s why I like preparing technical drawings to explain various concepts. So, here it is – a short story of how async/await works in .NET.

Dziel się z innymi:
.NET async/await in a single picture – TooSlowException

Inne 1430 dni, 23 godziny, 30 minut temu KonradKokosa 158 źrodło rozwiń

MenuHomeAboutArchivesSubscribe Opinions, thoughts, solutions by Paweł Pindel on At the beginning, it is worth considering what asynchronous programming is and why it is better than synchronous. Asynchronous programming involves approaching the problem in a completely different way. The point is that the program code does not execute line by line, waiting each time for the end of the operation to move on. It allows us to speed up the program to a great extent, release the main t...

Źródło: netsharpdev.com
Dziel się z innymi:
Asynchronous programming in .NET - introduction

Async-await to nie tylko rewolucja jeśli chodzi o IO czy wykonanie długich operacji. To także niesamowite możliwości jeśli chodzi o kontrolę przepływu w Twoim kodzie. Jak to zrobić? Zapraszam do artykułu

Źródło: blog.scooletz.com
Dziel się z innymi:
async-await i kontrolowanie przepływu w kodzie bez wyjątków

Sztuka programowania 1782 dni, 23 godziny, 46 minut temu Scooletz 240 źrodło rozwiń

Podczas nagrywania czwartego odcinka „Distributed .NET Core” (do którego oglądania serdecznie Cię zapraszam) wspólnie z Piotrkiem poruszyliśmy przez moment kwestię zasadności użycia async/await w tzw. „one line-rach” czyli metodach, których ciało posiada jedynie jedną linie i najczęściej jest implementowane za pomocą operatora „goes to” (nie mylić z lambdami). Przykład takiej metody:   public async Task

Tagi: async/await, C#
Źródło: foreverframe.net
Dziel się z innymi:
Czy async/await w "jednolinijkowcach" ma sens? - Forever F[r]ame

Sztuka programowania 1936 dni, 21 godzin, 51 minut temu dpawlukiewicz 309 źrodło rozwiń

O lokalności ConfigureAwait

Źródło: gist.github.com
Dziel się z innymi:
O lokalności ConfigureAwait

Sztuka programowania 1961 dni, 21 godzin, 43 minuty temu asciiBlade 203 źrodło rozwiń

Async programming becomes more and more popular. While being very convenient in use, from performance perspective there are scenarios where regular Task-returning async methods have one serious drawback: they need to allocate a new Task to represent the operation (and its result).

Tagi: async/await, C#, gc
Dziel się z innymi:
Implementing custom IValueTaskSource – async without allocations – TooSlowException

Inne 2107 dni, 22 godziny, 12 minut temu KonradKokosa 77 źrodło rozwiń

Programowanie asynchroniczne na dobre zagościło na platformie .NET. Proces transformacji wszystkich bibliotek nie był najszybszy, ale większość liczących się graczy na rynku komponentów przygotowało już wersje asynchroniczne. Z przyrostkiem Async czy bez, metody zwracające Task albo Task stały się naszą codziennością, zwiększając przepustowość aplikacji i zmniejszając jałowy czas czekania na zwrócenie danych przez bazę (albo dowolne inne IO). Zatem skoro cała asynchroniczność miała przynieść takie zyski...

Źródło: devstyle.pl
Dziel się z innymi:
200% asynchronicznej mocy w C# z .NET Core 2.1 | devstyle.pl

Programowanie rozproszone 2117 dni, 22 godziny, 46 minut temu Piotr Stapp 138 źrodło rozwiń

In the previous article, we started analyzing asynchronous programming in .NET world. There we made concerns about how this concept is somewhat misunderstood even though it has been around for more than six years, ie. since .NET 4.5. Using this programming style it is easier to write responsive applications that do asynchronous, non-blocking I/O operations. This is done by using async/await operators.  However, this concept is often misused. In this article, we will go through s...

Tagi: async/await
Źródło: rubikscode.net
Dziel się z innymi:
[EN] Asynchronous Programming in .NET – Common Mistakes and Best Practices | Rubik's Code

Sztuka programowania 2122 dni, 22 godziny, 37 minut temu Piotr Stapp 114 źrodło rozwiń

Reaktywowałem swojego bloga na nowo [https://teovincent.com/]. Blog skierowany jest do programistów, ale nie tylko. Znajdziesz tutaj również tematykę zarządzania, liderowania i rekrutacji. Menedżerowie wchodźcie do kategorii: OGARNIJ PRACĘ. Programistów zapraszam do kategorii: PROGRAMOWANIE, KONFERENCJE, HIPERŁĄCZE, KONKURS. Programowanie && !Programowanie Wykrzyknik „!” oznacza zaprzeczenie. Podwójny ampersand „&&” to operator, który zwraca wartość „prawda”, gdy oba jego argumenty zwraca...

Teo Vincent | Programowanie && !Programowanie

Sztuka programowania 2258 dni, 12 godzin, 39 minut temu TeoVincent 61 źrodło rozwiń

Last Tuesday, I had a talk in Wrocław about async/await in C# (thanks once again, you rock!). At some point, I asked the audience seemingly simple question. Why do we need async keyword at all? When I look at the folks, lots of them looked very confused since the answer seemed very obvious. Well, as you probably expect, it’s a little bit more complicated.    Async makes my method asynchronous… At the very beginning, I should explain why the answer to my ques...

Tagi: async/await, C#
Źródło: foreverframe.net
Dziel się z innymi:
Why do we need async keyword in C#? - Forever F[r]ame

Sztuka programowania 2333 dni, 22 godziny, 45 minut temu dpawlukiewicz 290 źrodło rozwiń

Najaktywniejsi w tym miesiącu