public static ServerManager Start(ServerChecker serverChecker,
            IEnumerable<string> connectionStrings,
            IEnumerable<string> failoverConnectionStrings,
            int checkInterval = 1000)
        {
            var sm = new ServerManager(serverChecker, connectionStrings, failoverConnectionStrings);
            var checkerTimer = new Timer(checkInterval);

            sm.serverChecker.DoCheckupOnAllServers(
                        sm.activeServers.Union(sm.failoverServers));

            checkerTimer.Elapsed += (o, e) =>
                {
                    checkerTimer.Enabled = false;
                    try
                    {
                        sm.serverChecker.DoCheckupOnAllServers(
                            sm.activeServers.Union(sm.failoverServers));
                    }
                    finally
                    {
                        checkerTimer.Enabled = true;
                    }
                };
            checkerTimer.Start();
            checkerTimers.Add(sm, checkerTimer);

            return sm;
        }
 public static ServerManager Start(ServerChecker serverChecker,
     IEnumerable<string> connectionStrings,
     int checkInterval = 1000)
 {
     return Start(serverChecker, connectionStrings,
         Enumerable.Empty<string>(), checkInterval);
 }
 public ServerManager(ServerChecker serverChecker,
     IEnumerable<string> connectionStrings,
     IEnumerable<string> failoverConnectionStrings)
 {
     this.serverChecker = serverChecker;
     this.activeServers = connectionStrings
         .Select(c => new Server(c)).ToList();
     this.failoverServers = failoverConnectionStrings
         .Select(c => new Server(c)).ToList();
 }
 public ServerManager(ServerChecker serverChecker,
     IEnumerable<string> connectionStrings)
     : this(serverChecker, connectionStrings,
     Enumerable.Empty<string>())
 {
 }