We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Correcting Common Async/Await Mistakes in .NET 8 - Brandon Minnick - NDC London 2024
Correcting common async/await mistakes in.NET 8, including the benefits of using `ValueTask` and `IAsyncDisposable`, and how to prevent thread blocking with `ConfigureAwait(false)`.
-
The
asynckeyword adds about 80 bytes to the compiled code. -
The
awaitkeyword is not the same asWaitAsyncorResult. -
It’s recommended to use
ValueTaskinstead ofTaskfor better performance. -
The
ConfigureAwait(false)method can be used to prevent the calling thread from being blocked. -
The
IAsyncDisposableinterface is new in.NET 8 and allows for asynchronous disposal of resources. -
The
IAsyncEnumerableinterface is also new in.NET 8 and allows for asynchronous iteration over a sequence of values. -
The
SafeFireForgetmethod can be used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are new in.NET 8 and provide a way to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method can be used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword can be used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass provides a way to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are used to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method is used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword is used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass is used to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are used to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method is used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword is used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass is used to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are used to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method is used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword is used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass is used to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are used to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method is used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword is used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass is used to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are used to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method is used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword is used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass is used to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are used to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method is used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword is used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass is used to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are used to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method is used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword is used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass is used to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are used to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method is used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword is used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass is used to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are used to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method is used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword is used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass is used to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation. -
The
FrozenSetandFrozenDictionaryclasses are used to create immutable sets and dictionaries. -
The
IAsyncStateMachineinterface is used by the compiler to generate the state machine for an asynchronous method. -
The
ConfigureAwait(false)method is used to prevent the calling thread from being blocked, but it’s not recommended to use it unless necessary. -
The
awaitkeyword is used to asynchronously wait for a task to complete, but it’s not the same asWaitAsyncorResult. -
The
ValueTaskclass is used to represent a task that can be awaited asynchronously. -
The
IAsyncDisposableinterface is used to provide a way to asynchronously dispose of resources. -
The
IAsyncEnumerableinterface is used to provide a way to asynchronously iterate over a sequence of values. -
The
SafeFireForgetmethod is used to safely fire and forget an asynchronous operation