How to time out an async operation with CancellationTokenSource.CancelAfter in C#
Use CancellationTokenSource.CancelAfter to enforce an async deadline in .NET 11: constructor vs CancelAfter, linked tokens for composing timeouts with caller tokens, exception disambiguation, Task.WaitAsync, TryReset for pooling, and testable timeouts with TimeProvider.