'Closes all sessions and connection associated with this Cluster.
To ensure all connections are properly closed, **you should always
call shutdown() on a Cluster instance when you are done with it**.
Once shutdown, a Cluster should not be used for any purpose.'

def shutdown(self):

    with self._lock:
        if self.is_shutdown:
            return
        else:
            self.is_shutdown = True
    if self._idle_heartbeat:
        self._idle_heartbeat.stop()
    self.scheduler.shutdown()
    self.control_connection.shutdown()
    for session in self.sessions:
        session.shutdown()
    self.executor.shutdown()
    _discard_cluster_shutdown(self)
