private ThreadStart AllJobs() { return(() => executeWithExecutor(executor => { CleanupJob job = null; do { try { job = _jobs.poll(100, TimeUnit.MILLISECONDS); if (job != null) { job.Run(executor); } } catch (Exception) { // There's no audience for these exceptions. The jobs themselves know if they've failed and communicates // that to its tree. The scheduled job is just a vessel for running these cleanup jobs. } finally { if (job != null) { job.Close(); } } } while (!_jobs.Empty || !_started); // Even if there are no jobs in the queue then continue looping until we go to started state })); }
public override void Add(CleanupJob job) { ExecuteWithExecutor(executor => { try { job.Run(executor); } finally { job.Close(); } }); }
public override void Add(CleanupJob job) { job.Close(); }