DotNext by Roman Sakno

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

 EventHandlerFuture

using System; using System.Runtime.CompilerServices; using System.Threading; namespace DotNext.Runtime.CompilerServices { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1 })] internal sealed class EventHandlerFuture : AsyncDelegateFuture<EventHandler> { private readonly object sender; private readonly EventArgs args; internal EventHandlerFuture(object sender, EventArgs args, CancellationToken token) : base(token) { this.sender = sender; this.args = args; } private protected override void InvokeOne(EventHandler handler) { handler(sender, args); } } }