DotNext.Threading by .NET Foundation and Contributors

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

 LinkedTokenSourceFactory

public static class LinkedTokenSourceFactory
Represents helper methods for working with linked cancellation tokens.

Links two cancellation tokens.

public static CancellationTokenSource LinkTo(this ref CancellationToken token, TimeSpan timeout)

Links cancellation token with the timeout.

public static CancellationTokenSource LinkTo(this ref CancellationToken first, TimeSpan timeout, CancellationToken second)

Links two cancellation tokens with the given timeout.