Exemple #1
0
        public Task Start()
        {
            if (_thread != null)
            {
                throw new InvalidOperationException("Already a thread running.");
            }

            _queueMonitor.Register(this);

            _stopped.Reset();

            _thread = new Thread(ReadFromQueue)
            {
                IsBackground = true, Name = Name
            };
            _thread.Start();
            return(_tcs.Task);
        }
 public Task Start()
 {
     _queueMonitor.Register(this);
     return(_tcs.Task);
 }
 public void Start()
 {
     _queueStats.Start();
     _queueMonitor.Register(this);
 }