Exemple #1
0
 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);
 }
Exemple #2
0
        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;
        }