System.Linq.Async by .NET Foundation and Contributors

<PackageReference Include="System.Linq.Async" Version="6.0.1" />

.NET API 1,116,304 bytes

 CancellationTokenDisposable

using System.Runtime.CompilerServices; using System.Threading; namespace System.Linq { internal sealed class CancellationTokenDisposable : IDisposable { [System.Runtime.CompilerServices.Nullable(1)] private readonly CancellationTokenSource _cts = new CancellationTokenSource(); public CancellationToken Token => _cts.Token; public void Dispose() { if (!_cts.IsCancellationRequested) _cts.Cancel(); } } }