DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="1.1.0" />

 CanceledAsyncDelegateFuture

using System; using System.Threading; namespace DotNext.Runtime.CompilerServices { internal sealed class CanceledAsyncDelegateFuture : AsyncDelegateFuture { internal static readonly AsyncDelegateFuture Instance = new CanceledAsyncDelegateFuture(); public sealed override bool IsCompleted => true; private CanceledAsyncDelegateFuture() : base(new CancellationToken(true)) { } private protected override void ThrowIfNeeded() { throw new OperationCanceledException(token); } } }