Example #1
0
        public static void f_jobTest_Handle()
        {
            IJobContext jc     = new JobMonitor();
            IJob        jo     = new JobTest(jc);
            IJobHandle  handle = new JobHandle(jo);

            /////////////////////////////////////////////////////
            Console.WriteLine("Enter to exit...");
            Console.ReadLine();
        }
Example #2
0
        public static void f_RUN()
        {
            f_geckoSetting();

            jom = new JobMonitor();
            Application.EnableVisualStyles();


            //Application.Run(new fMedia());
            //Application.Run(new fMain());
            //Application.Run(new fEdit());
            //Application.Run(new fBrowser());
            //Application.Run(new fGeckFX());
            //main = new fApp(jobs);
            //main = new fNone(jom);
            //Application.Run(main);
            f_Exit();
        }
Example #3
0
        public static void f_jobTest_Factory()
        {
            IJobContext jc = new JobMonitor();

            jc.f_createNew(new JobTest(jc));
            jc.f_createNew(new JobTest(jc));
            jc.f_createNew(new JobTest(jc));
            jc.f_createNew(new JobTest(jc));
            jc.f_createNew(new JobTest(jc));

            /////////////////////////////////////////////////////

            Console.WriteLine("Enter to send many request to load balancer jobs on factory ...");
            Console.ReadLine();
            const int len = 9;

            Message[] ms = new Message[len];
            for (int i = 0; i < len; i++)
            {
                ms[i] = new Message()
                {
                    Input = i
                };
                if (i == 0)
                {
                    ms[i].f_setTimeOut(30000);
                }
                if (i == 5)
                {
                    ms[i].f_setTimeOut(7000);
                }
                if (i == 8)
                {
                    ms[i].f_setTimeOut(5000);
                }
            }

            Func <IJobHandle, Guid, bool> responseCallbackDoneAll = (msgHandle, groupId) =>
            {
                System.Tracer.WriteLine("TEST_JOB.RUN_TEST(): FINISH ....");
                return(false);
            };

            jc.f_sendRequestMessages(JOB_TYPE.NONE, ms, responseCallbackDoneAll);

            /////////////////////////////////////////////////////


            //jobs.OnStopAll += (se, ev) => {
            //    Tracer.WriteLine(">>>>> STOP ALL JOBS: DONE ...");
            //};

            //while (true)
            //{
            //    Console.WriteLine("Enter to stop all...");
            //    Console.ReadLine();
            //    jobs.f_job_stopAll();
            //    Console.WriteLine("Enter to restart all...");
            //    Console.ReadLine();
            //    jobs.f_restartAllJob();
            //}

            /////////////////////////////////////////////////////

            Console.WriteLine("Enter to stop all JOB...");
            Console.ReadLine();
            jc.f_removeAll();

            /////////////////////////////////////////////////////
            Console.WriteLine("Enter to exit...");
            Console.ReadLine();
        }