/// <summary> /// Starts the async executor </summary> public virtual void Start() { if (isActive) { return; } logger.LogInformation($"Starting up the default async job executor [{this.GetType().FullName}]."); if (timerJobRunnable == null) { timerJobRunnable = new AcquireTimerJobsRunnable(this, processEngineConfiguration.JobManager); } if (resetExpiredJobsRunnable == null) { resetExpiredJobsRunnable = new ResetExpiredJobsRunnable(this); } if (!isMessageQueueMode && asyncJobsDueRunnable == null) { asyncJobsDueRunnable = new AcquireAsyncJobsDueRunnable(this); } if (!isMessageQueueMode) { InitAsyncJobExecutionThreadPool(); StartJobAcquisitionThread(); } StartTimerAcquisitionThread(); StartResetExpiredJobsThread(); isActive = true; ExecuteTemporaryJobs(); }
/// <summary> /// Shuts down the whole job executor </summary> public virtual void Shutdown() { lock (syncRoot) { if (!isActive) { return; } logger.LogInformation($"Shutting down the default async job executor [{this.GetType().FullName}]."); if (timerJobRunnable != null) { timerJobRunnable.Stop(); } if (asyncJobsDueRunnable != null) { asyncJobsDueRunnable.Stop(); } if (resetExpiredJobsRunnable != null) { resetExpiredJobsRunnable.Stop(); } StopResetExpiredJobsThread(); StopTimerAcquisitionThread(); StopJobAcquisitionThread(); StopExecutingAsyncJobs(); timerJobRunnable = null; asyncJobsDueRunnable = null; resetExpiredJobsRunnable = null; isActive = false; } }
public CommandAnonymousInnerClass(AcquireTimerJobsRunnable outerInstance, AcquiredTimerJobEntities acquiredJobs) { this.outerInstance = outerInstance; this.acquiredJobs = acquiredJobs; }