<PackageReference Include="Nito.AsyncEx.Coordination" Version="5.1.1" />

Nito.AsyncEx.PauseTokenSource

public sealed class PauseTokenSource
The source (controller) of a "pause token", which can be used to cooperatively pause and unpause operations.
namespace Nito.AsyncEx { public sealed class PauseTokenSource { public bool IsPaused { get; set; } public PauseToken Token { get; } public PauseTokenSource(); } }