Which do I use, ConfigureAwait True or False?

Описание к видео Which do I use, ConfigureAwait True or False?

In this video we answer the ever popular question "Which do I use, ConfigureAwait True or False?".

The direct answer to this question is:
- If you are a writing code for the UI, use ConfigureAwait(true).
- If you are writing code in a library that will be shared, use ConfigureAwait(false)

If you want to know why, then keep watching until the end, because I teach you the difference between ConfigureAwait(true) and ConfigureAwait(false).

We start by understanding exactly how the await keyword in C# works. You learn about the continuation task and how to properly use ConfigureAwait to control which thread the continuation task runs on and why that's important.

We talk about why the UI code relies on ConfigureAwait(true) and what happens if you set ConfigureAwait(false). Hint: you'll get a threading exception.

We'll also cover why you need to use ConfigureAwait(false) in all of your library code to help protect the consumers of your code from encountering deadlocks and other threading issues.

Be sure to watch my new Pluralsight course "Introduction to Prism for WPF":
https://pluralsight.pxf.io/bE3rB

Sponsor Me:
https://github.com/sponsors/brianlagunas

Follow Me:
Twitter:   / brianlagunas  
Twitch:   / brianlagunas  
Blog: http://brianlagunas.com
GitHub: https://github.com/brianlagunas

Комментарии

Информация по комментариям в разработке