DotNext.Threading by Roman Sakno

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

 AsyncBridge

public static class AsyncBridge
Allows to turn WaitHandle and CancellationToken into task.
public static CancellationTokenFuture WaitAsync(this CancellationToken token, bool completeAsCanceled = false)

Obtains a task that can be used to await token cancellation.

public static WaitHandleFuture WaitAsync(this WaitHandle handle, TimeSpan timeout)

Obtains a task that can be used to await handle completion.

public static WaitHandleFuture WaitAsync(this WaitHandle handle)

Obtains a task that can be used to await handle completion.