Example #1
0
        private static void RunTaskOnNewThread(object threadSleepTask)
        {
            if (threadSleepTask == null)
            {
                return;
            }
            ThreadSleepTask task = (ThreadSleepTask)threadSleepTask;

            log.Info("deserialized ThreadSleep task");

            // give a little time to make sure the taskqueue was updated after spawning the thread
            Thread.Sleep(10000); // 10 seconds

            task.RunTask();

            log.Info("started ThreadSleep task");
        }
        void btnTest_Click(object sender, EventArgs e)
        {
            ThreadSleepTask testTask = new ThreadSleepTask();
            testTask.SiteGuid = siteSettings.SiteGuid;
            testTask.TaskName = "Test task that just sleeps a bit";
            testTask.QueueTask();

            WebUtils.SetupRedirect(this, Request.RawUrl);
        }