public Task StopAsync(CancellationToken cancellationToken = default) { StoppingTokenSource.Cancel(); Timer.Stop(cancellationToken); StoppingTokenSource.Dispose(); return(Task.CompletedTask); }
public virtual Task StopAsync(CancellationToken cancellationToken = default) { Logger.LogDebug("Stopped background worker: " + ToString()); StoppingTokenSource.Cancel(); StoppingTokenSource.Dispose(); return(Task.CompletedTask); }