Run() public method

public Run ( ) : void
return void
Esempio n. 1
0
        public static void Execute(string jobName, bool continuous, IDictionary <string, string> overrideSettings)
        {
            // Create the settings manager
            var settings = new Settings(overrideSettings);
            var worker   = new WorkerRole(settings);

            // See which mode we're in
            if (String.IsNullOrWhiteSpace(jobName))
            {
                // Run ALL THE JOBS!
                worker.OnStart();
                worker.Run();
                Console.WriteLine("Worker is running. Press ENTER to stop");
                Console.ReadLine();
                worker.Stop();
                worker.OnStop();
            }
            else
            {
                // Run JUST ONE JOB!
                if (!continuous)
                {
                    worker.RunSingleJob(jobName);
                }
                else
                {
                    worker.RunSingleJobContinuously(jobName);
                }
            }
        }
Esempio n. 2
0
        public static void Execute(string jobName, bool continuous, IDictionary<string, string> overrideSettings)
        {
            // Create the settings manager
            var settings = new Settings(overrideSettings);
            var worker = new WorkerRole(settings);

            // See which mode we're in
            if (String.IsNullOrWhiteSpace(jobName))
            {
                // Run ALL THE JOBS!
                worker.OnStart();
                worker.Run();
                Console.WriteLine("Worker is running. Press ENTER to stop");
                Console.ReadLine();
                worker.Stop();
                worker.OnStop();
            }
            else
            {
                // Run JUST ONE JOB!
                if (!continuous)
                {
                    worker.RunSingleJob(jobName);
                }
                else
                {
                    worker.RunSingleJobContinuously(jobName);
                }
            }
        }