public static async Task StopAndWait(this IIS.Site site) { site.Stop(); await WaitForState(() => site.State, IIS.ObjectState.Stopped); }
private static void WatchSite(Site site) { do { var state = site.State; Debug("Current site state: {0}", state); if (state != ObjectState.Starting && state != ObjectState.Started) { Debug("Stopping site"); site.Stop(); return; } System.Threading.Thread.Sleep(CHECK_DELAY_MS); } while (true); }
public static void StopAndWait(this IIS.Site site) { var wait = new PollingWait(() => site.Stop(), () => site.State == IIS.ObjectState.Stopped); wait.Invoke(); }