@classmethod
def set_idle_ttl(cls, pid, ttl):
    """Set the idle TTL for a pool, after which it will be destroyed.

        :param str pid: The pool id
        :param int ttl: The TTL for an idle pool

        """
    with cls._lock:
        cls._ensure_pool_exists(pid)
        cls._pools[pid].set_idle_ttl(ttl)
