Regarding this example:
return Task.Run(
async () => {
while (!stoppingToken.IsCancellationRequested) {
await Task.Delay(1000);
}
}, stoppingToken);
Should I pass the stoppingToken
to Task.Run
or not? How does this changes the code behavior?