コード例 #1
0
ファイル: WebFarmManager.cs プロジェクト: brigs/ConDep
        private IEnumerable <FarmServerStats> ChangeState(Action <StateExecutor> changeState, Action <object> writeObject = null, WaitCondition waitCondition = null)
        {
            var stats = new List <FarmServerStats>();

            foreach (var farm in Farms)
            {
                foreach (var server in farm.Servers)
                {
                    using (var arr = new ArrServerManager(server.WebFarm, server.Name))
                    {
                        changeState(arr.StateExecutor);
                        arr.Commit();

                        if (waitCondition != null)
                        {
                            while (waitCondition(arr.Counters))
                            {
                                Thread.Sleep(100);
                            }
                        }
                        if (writeObject != null)
                        {
                            writeObject(arr.Counters.GetServerStats());
                        }
                    }
                }
            }
            return(stats);
        }
コード例 #2
0
ファイル: WebFarmManager.cs プロジェクト: kjelliverb/ConDep
        private IEnumerable<FarmServerStats> ChangeState(Action<StateExecutor> changeState, Action<object> writeObject = null, WaitCondition waitCondition = null)
        {
            var stats = new List<FarmServerStats>();

            foreach (var farm in Farms)
            {
                foreach (var server in farm.Servers)
                {
                    using (var arr = new ArrServerManager(server.WebFarm, server.Name))
                    {
                        changeState(arr.StateExecutor);
                        arr.Commit();

                        if(waitCondition != null)
                        {
                            while(waitCondition(arr.Counters))
                            {
                                Thread.Sleep(100);
                            }
                        }
                        if(writeObject != null)
                        {
                            writeObject(arr.Counters.GetServerStats());
                        }
                    }
                }
            }
            return stats;
        }