'Close all connections.  ``Session`` instances should not be used
for any purpose after being shutdown.'

def shutdown(self):

    with self._lock:
        if self.is_shutdown:
            return
        else:
            self.is_shutdown = True
    for future in self._initial_connect_futures:
        future.cancel()
    wait_futures(self._initial_connect_futures)
    for pool in tuple(self._pools.values()):
        pool.shutdown()
