public MaintenanceTaskScheduler( ITracer tracer, PhysicalFileSystem fileSystem, IScalarVerbRunner scalarVerb, IScalarRepoRegistry repoRegistry) { this.tracer = tracer; this.fileSystem = fileSystem; this.scalarVerb = scalarVerb; this.repoRegistry = repoRegistry; this.taskTimers = new List <Timer>(); this.taskQueue = new ServiceTaskQueue(this.tracer); }
public void Dispose() { this.taskQueue.Stop(); foreach (Timer timer in this.taskTimers) { using (ManualResetEvent timerDisposed = new ManualResetEvent(initialState: false)) { timer.Dispose(timerDisposed); timerDisposed.WaitOne(); } } this.taskQueue.Dispose(); this.taskQueue = null; this.taskTimers = null; }