private static void RunDemo(Smoulder <ProcessDataObject, DistributeDataObject> smoulder) { Console.WriteLine("--------- Beginning Smoulder demo run ---------"); //Nothing is running yet, so both queues have 0 items on them GetReport(smoulder); //Start smoulder running at system start up smoulder.Start(); //Queues now have items on them, data filtering through smoulder GetReport(smoulder); //Leave smoulder running indefinately for (var i = 0; i < 10; i++) { Thread.Sleep(100); GetReport(smoulder); } //System can be paused, stop the smoulder object smoulder.Stop(); Console.WriteLine("Smoulder has been paused, waiting for 1.5 seconds before restarting"); Thread.Sleep(1500); Console.WriteLine("Smoulder restarting"); //Smoulder can be restarted smoulder.Start(); GetReport(smoulder); for (var i = 0; i < 50; i++) { Thread.Sleep(100); GetReport(smoulder); } smoulder.Stop(); GetReport(smoulder); Console.WriteLine("--------- Ending Smoulder demo run ---------"); Console.WriteLine(); Console.WriteLine(); }
private static void GetReport(Smoulder <ProcessDataObject, DistributeDataObject> smoulder) { Console.WriteLine("Processor Items: " + smoulder.ProcessorQueueItems); Console.WriteLine("Distributor Items: " + smoulder.DistributorQueueItems); }