Exemple #1
0
 public Producer(int min, int max, Queue <Task> queue)
 {
     _minDuration = min;
     _maxDuration = max;
     _queue       = queue;
     _rnd         = new Random();
     _minutesTillNextProduction = _rnd.Next(_minDuration, _maxDuration);
     _clock = FastClock.Instance;
     _clock.OneMinuteIsOver += Instance_OneMinuteIsOver;
 }
Exemple #2
0
        public Consumer(int min, int max, FastClock fastClock, Queue <Task> queue)
        {
            _fastClock   = fastClock;
            _queue       = queue;
            _maxDuration = max;
            _minDuration = min;

            _random = new Random(DateTime.Now.Millisecond);
            _fastClock.OneMinuteIsOver += Instance_OneMinuteIsOver;
        }