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();
        }
Esempio n. 3
0
 public void Init()
 {
     _jobQueue = new JobQueue();
     _jobQueue.Clear();
 }
Esempio n. 4
0
 /// <summary>
 /// 在job执行循环退出后,job执行线程退出前
 /// </summary>
 protected virtual void PostJobLoop()
 {
     JobQueue.Clear();
     JobQueue = null;
 }
Esempio n. 5
0
 private void btnClear_Click(object sender, RoutedEventArgs e)
 {
     JobQueue.Clear();
 }