Exemple #1
0
        public void Dispose()
        {
            _queue?.Dispose();
            _queue = null;

            _fs1?.Dispose();
            _fs1 = null;
        }
        public void QueueProcessorTest010()
        {
            QueueProcessor <string> queue = new QueueProcessor <string>("string", str =>
            {
                Console.WriteLine($"{DateTime.Now} Renderer: {str}");
                Thread.Sleep(200);
            });

            for (int i = 0; i < 70; i++)
            {
                queue.Append($"Item {i}");
            }

            Thread.Sleep(2000);
            Console.WriteLine($"{DateTime.Now} dispose thread");
            queue.Dispose();
            Console.WriteLine($"{DateTime.Now} continue thread");
        }