예제 #1
0
 internal void Dequeue_messages(Func <bool> isRunning)
 {
     do
     {
         var work = _getWorkFromResource();
         if (work.Item1)
         {
             Dequeued(work.Item2);
         }
         else
         {
             _resource.Wait(1000);
         }
     } while(isRunning());
 }
        internal void Dequeue_messages(TryDequeueDelegate <T> trydequeue, Func <bool> isRunning)
        {
            var msg = default(T);

            do
            {
                if (trydequeue(out msg))
                {
                    Dequeued(msg);
                }
                else
                {
                    _resource.Wait(Timeout.Infinite);
                }
            } while(isRunning());
        }