Beispiel #1
0
        public void Listen()
        {
            while (!Finished)
            {
                while (Queue.Count > 0)
                {
                    try
                    {
                        lock (LockToken)
                            Cmdlet.OutputProvider.WriteLine(Queue.Take());
                    }
                    catch (Exception e)
                    {
                        if (e is PipelineStoppedException)
                        {
                            Finished = true;

                            break;
                        }
                        throw e;
                    }
                }
                if (TerminateThreads)
                {
                    Cmdlet.OutputProvider.WriteLine("Too many errors. aborting stress testing");
                    Cmdlet.StopProcess();
                    return;
                }
                Thread.Sleep(1000);
            }
        }