~/talk

Correcting Common Async/Await Mistakes in .NET 8

Talkat dotnetdays 2024 · 2024-04-18..04-20· [dotnet, concurrency]
slides:none on file

Covers concrete fixes for .NET 8 async pitfalls: non-awaited Tasks silently swallow exceptions, Task.Run fire‑and‑forget creates hidden bugs, and async methods inflate assemblies by about 80 bytes each. Demonstrates using ConfigureAwait(false) and new ConfigureAwaitOptions (including force yielding), prefers ValueTask when the hot path is sync, streams results with IAsyncEnumerable and await foreach to show items progressively, and recommends the SafeFireAndForget NuGet (≈1.7M downloads) for controlled fire‑and‑forget with exception handling.

AI-written summary · about

  1. 0:00Introduction to async/await
  2. 1:03How async/await works under the hood
  3. 18:39Non-awaited tasks hide exceptions
  4. 21:25Async in constructors and fire-and-forget
  5. 31:23Cancellation tokens and delays
  6. 35:15ConfigureAwait false explained
  7. 41:28Why not to use Wait or Result
  8. 46:00Async streams with IAsyncEnumerable
  9. 48:30Returning Task vs await Task
  10. 50:38ValueTask for hot path methods
  11. 52:20Summary of async/await best practices
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.