Exemplo n.º 1
0
        public ActionResult Exec()
        {
            var idp   = System.Diagnostics.Process.GetCurrentProcess().Id;
            var rnd   = new Random();
            var m_rnd = rnd.Next(100, 999);

            var ex = Executor.Instance;

            {
                ex.AfterExec += AfterExec;
                for (var i = 0; i < 30; i++)
                {
                    if (m_execState == ExecWorkingThread.Terminate)
                    {
                        break;
                    }
                    m_execState = ExecWorkingThread.Continue;
                    ex.ExecToQueue($"[{idp} / {m_rnd}] volani: {i}");
                    while (m_execState == ExecWorkingThread.Continue)
                    {
                        Thread.Sleep(50);
                    }
                }
            }
            return(View("Index"));
        }
Exemplo n.º 2
0
 private void AfterExec(ExecDTO data)
 {
     m_execState = ExecWorkingThread.Done;
     Debug.WriteLine(data.Data);
 }