def METHOD_NAME(self):
    with self.__lock:
        while not self.__queue.empty():
            session = self.__queue.get(block=False)
            session.METHOD_NAME()
            self.__pool_size -= 1
    self.__closed = True
    logger.info("SessionPool has been closed successfully.")