<PackageReference Include="Nito.AsyncEx.Tasks" Version="5.1.0" />

Nito.AsyncEx.CancellationTokenTaskSource<T>

public sealed class CancellationTokenTaskSource<T> : IDisposable
Holds the task for a cancellation token, as well as the token registration. The registration is disposed when this instance is disposed.
namespace Nito.AsyncEx { public sealed class CancellationTokenTaskSource<[System.Runtime.CompilerServices.Nullable(2)] T> : IDisposable { public Task<T> Task { get; } public CancellationTokenTaskSource(CancellationToken cancellationToken); public void Dispose(); } }