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