public IEnumerable<Host> NewQueryPlan(IStatement query) { IReconnectionSchedule schedule = _reconnectionPolicy.NewSchedule(); while (true) { IEnumerable<Host> childQueryPlan = _loadBalancingPolicy.NewQueryPlan(query); foreach (Host host in childQueryPlan) yield return host; if (ReconnectionEvent != null) { var ea = new RetryLoadBalancingPolicyEventArgs(schedule.NextDelayMs()); ReconnectionEvent(this, ea); if (ea.Cancel) break; } else Thread.Sleep((int) schedule.NextDelayMs()); } }