Esempio n. 1
0
        private void check()
        {
            try
            {
                if (disposed)
                {
                    return;
                }
                List <TJob> jobs = null;

                lock (list)
                {
                    if (list.Count > 0)
                    {
                        jobs = list.ToList();
                        list.Clear();
                    }
                }

                if (jobs != null)
                {
                    NewJobs?.Invoke(jobs);
                }
            }
            finally
            {
                if (!disposed)
                {
                    timer.Start();
                }
            }
        }
Esempio n. 2
0
 public void Start()
 {
     IsRunning = true;
     task.Start();
 }
Esempio n. 3
0
 public JobDequeuer(int sleepMilliseconds)
 {
     list  = new List <TJob>();
     timer = new DelayedTask(check, sleepMilliseconds);
     timer.Start();
 }