예제 #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);
 }
예제 #3
0
 public void Start()
 {
     _queueStats.Start();
     _queueMonitor.Register(this);
 }