How to create a thread/Task with a continuous loop?
Something like this would work: var cancellationTokenSource = new CancellationTokenSource(); var task = Repeat.Interval( TimeSpan.FromSeconds(15), () => CheckDatabaseForNewReports(), cancellationTokenSource.Token); The Repeat class looks like this: internal static class Repeat { public static Task Interval( TimeSpan pollInterval, Action action, CancellationToken token) { // We don’t use Observable.Interval: // If we block, the values start bunching up … Read more