public void SetupQueue() { JobConfiguration.AppSettings = Settings.Default; Repository = new FileQueueRepository<Job>(Environment.CurrentDirectory + "\\queue"); var fileErrorRep = new FileQueueRepository<Job>(Environment.CurrentDirectory + "\\queue-error"); var fileExecutedRep = new FileQueueRepository<Job>(Environment.CurrentDirectory + "\\queue-executed"); JobQueue = new JobQueue { Repository = Repository, ErroredJobs = fileErrorRep, ExecutedJobs = fileExecutedRep, LoggerDelegate = Logger}; JobQueue.Clear(); JobQueue.ErroredJobs.Clear(); JobQueue.ExecutedJobs.Clear(); }
public void SetupQueue() { JobConfiguration.AppSettings = Settings.Default; var conn = new SqlConnection { ConnectionString = Settings.Default.ConnectionString }; Repository = new SqlQueueRepository<Job>(conn, "ActiveItems"); var sqlErrorRep = new SqlQueueRepository<Job>(conn, "ErroredItems"); var sqlExecutedRep = new SqlQueueRepository<Job>(conn, "ExecutedItems"); JobQueue = new JobQueue { Repository = Repository, ErroredJobs = sqlErrorRep, ExecutedJobs = sqlExecutedRep, LoggerDelegate = Logger }; JobQueue.Clear(); JobQueue.ErroredJobs.Clear(); JobQueue.ExecutedJobs.Clear(); }
public void Init() { _jobQueue = new JobQueue(); _jobQueue.Clear(); }
/// <summary> /// 在job执行循环退出后,job执行线程退出前 /// </summary> protected virtual void PostJobLoop() { JobQueue.Clear(); JobQueue = null; }
private void btnClear_Click(object sender, RoutedEventArgs e) { JobQueue.Clear(); }