Pushdown() публичный Метод

Destroys this instance app domain.
public Pushdown ( bool force ) : void
force bool A value indicating whether to force destruction immediately, /// without waiting for pending jobs to complete.
Результат void
Пример #1
0
        /// <summary>
        /// Raises the bootstraps' ApplicationFilesChanged event.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private static void BootstrapsApplicationFilesChanged(object sender, FileSystemEventArgs e)
        {
            logger.Info("A change was detected in '{0}'. Shutting down.", e.FullPath);

            lock (Locker)
            {
                if (bootstraps != null)
                {
                    bootstraps.Pushdown(false);
                    bootstraps.Dispose();
                    bootstraps = null;
                }
            }

            logger.Info("Re-starting the application at '{0}'.", options.ApplicationPath);
            PullupBootstraps();
        }
Пример #2
0
        public void BootstrapsPullUpAndExcecuteJobWithHttpApplicationEntryPoint()
        {
            string path = ApplicationUtils.CreateValidExampleApplication();

            using (Bootstraps bootstraps = new Bootstraps(path, null, 500))
            {
                Assert.AreEqual(BootstrapsPullupResultType.Success, bootstraps.PullUp(true).ResultType);

                CreateFileJob job = new CreateFileJob()
                {
                    Path = Path.Combine(path, Path.GetRandomFileName())
                };

                Assert.IsFalse(File.Exists(job.Path));

                using (IRepository repository = new SQLiteRepository(string.Format(CultureInfo.InvariantCulture, "data source={0};journal mode=Off;synchronous=Off;version=3", Path.Combine(path, "BlueCollar.sqlite"))))
                {
                    job.Enqueue("Default", null, repository);
                }

                Thread.Sleep(6000);
                Assert.IsTrue(File.Exists("HttpApplicationStart"));

                bootstraps.Pushdown(true);
                Assert.IsTrue(File.Exists("HttpApplicationEnd"));
            }
        }