'Checks for dead threads and attempts to restart them. If the connection appears to be throttled, it won\'t
attempt to reconnect for 30s.
:return:'

def start(self):

    global irc_connections
    self.start_connections()
    schedule = {}
    while (not self.shutdown_event.is_set()):
        for (conn_name, conn) in irc_connections.items():
            if (not conn.running):
                continue
            now = datetime.now()
            if ((not conn) and self.config.get(conn_name)):
                try:
                    self.restart_connection(conn_name, self.config[conn_name])
                except IOError as e:
                    log.error(e)
            elif ((not conn.is_alive()) and conn.running):
                if (conn_name not in schedule):
                    schedule[conn_name] = (now + timedelta(seconds=5))
                if conn.throttled:
                    schedule[conn_name] += timedelta(seconds=self.delay)
                if (schedule[conn_name] <= now):
                    log.error(u'IRC    connection    for    %s    has    died    unexpectedly.    Restarting    it.', conn_name)
                    try:
                        self.restart_connection(conn_name, conn.config)
                    except IOError as e:
                        log.error(e)
                    del schedule[conn_name]
        time.sleep(1)
    self.stop_connections(self.wait)
    irc_connections = {}
