Пример #1
0
        public override void Run()
        {
            TaskScheduler.UnobservedTaskException += OnUnobservedTaskException;
            running = true;

            while (running)
            {
                if (!MaintenanceMode.IsInMaintainanceMode)
                {
                    Trace.WriteLine("Starting the command processor", "Information");
                    using (var processor = new ConferenceProcessor(InstrumentationEnabled)) {
                        processor.Start();

                        while (running && !MaintenanceMode.IsInMaintainanceMode)
                        {
                            Thread.Sleep(10000);
                        }

                        processor.Stop();

                        // cause the process to recycle
                        return;
                    }
                }
                Trace.TraceWarning("Starting the command processor in mantainance mode.");
                while (running && MaintenanceMode.IsInMaintainanceMode)
                {
                    Thread.Sleep(10000);
                }
            }

            TaskScheduler.UnobservedTaskException -= OnUnobservedTaskException;
        }
Пример #2
0
        public override void Run()
        {
            this.running = true;

            MaintenanceMode.RefreshIsInMaintainanceMode();
            if (!MaintenanceMode.IsInMaintainanceMode)
            {
                Trace.WriteLine("Starting the command processor", "Information");
                using (var processor = new ConferenceProcessor())
                {
                    processor.Start();

                    while (this.running)
                    {
                        Thread.Sleep(10000);
                    }

                    processor.Stop();
                }
            }
            else
            {
                Trace.TraceWarning("Starting the command processor in mantainance mode.");
                while (this.running)
                {
                    Thread.Sleep(10000);
                }
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            DatabaseSetup.Initialize();

            using (var processor = new ConferenceProcessor()) {
                processor.Start();

                Console.WriteLine("Host started");
                Console.WriteLine("Press enter to finish");

                Console.ReadLine();

                processor.Stop();
            }
        }
        static void Main(string[] args)
        {
            Database.DefaultConnectionFactory = new ServiceConfigurationSettingConnectionFactory(Database.DefaultConnectionFactory);

            using (var processor = new ConferenceProcessor())
            {
                processor.Start();

                Console.WriteLine("Host started");
                Console.WriteLine("Press enter to finish");
                Console.ReadLine();

                processor.Stop();
            }
        }
Пример #5
0
        private static void Main(string[] args)
        {
            // Cleanup default EF DB initializers.
            DatabaseSetup.Initialize();

            using (var processor = new ConferenceProcessor(false)) {
                processor.Start();

                Console.WriteLine("Host started");
                Console.WriteLine("Press enter to finish");
                Console.ReadLine();

                processor.Stop();
            }
        }
Пример #6
0
        static void Main()
        {
            // Cleanup default EF DB initializers.
            DatabaseSetup.Initialize();

            using (var processor = new ConferenceProcessor(false))
            {
                processor.Start();

                Console.WriteLine("Host started");
                Console.WriteLine("Press enter to finish");
                Console.ReadLine();

                processor.Stop();
            }
        }
Пример #7
0
 public static void BeforeTestRun()
 {
     Database.DefaultConnectionFactory = new ServiceConfigurationSettingConnectionFactory(Database.DefaultConnectionFactory);
     
     tokenSource = new CancellationTokenSource();
     processorTask = Task.Factory.StartNew(() =>
     {
         using (var processor = new ConferenceProcessor())
         {
             try
             {
                 processor.Start();
                 WaitHandle.WaitAny(new[] {tokenSource.Token.WaitHandle});
             }
             finally
             {
                 processor.Stop();
             }
         }
     }, tokenSource.Token);
 }
Пример #8
0
        public override void Run()
        {
            TaskScheduler.UnobservedTaskException += this.OnUnobservedTaskException;
            this.running = true;

            while (this.running)
            {
                if (!MaintenanceMode.IsInMaintainanceMode)
                {
                    Trace.WriteLine("Starting the command processor", "Information");
                    using (var processor = new ConferenceProcessor(this.InstrumentationEnabled))
                    {
                        processor.Start();

                        while (this.running && !MaintenanceMode.IsInMaintainanceMode)
                        {
                            Thread.Sleep(10000);
                        }

                        processor.Stop();

                        // cause the process to recycle
                        return;
                    }
                }
                else
                {
                    Trace.TraceWarning("Starting the command processor in mantainance mode.");
                    while (this.running && MaintenanceMode.IsInMaintainanceMode)
                    {
                        Thread.Sleep(10000);
                    }
                }
            }

            TaskScheduler.UnobservedTaskException -= this.OnUnobservedTaskException;
        }