def METHOD_NAME(self, closed_is_special=True):
    now = time.time()
    expiration = self._connection.get_timer()
    if expiration is None:
        expiration = now + 3600  # arbitrary "big" value
    interval = max(expiration - now, 0)
    if self._closed and closed_is_special:
        # lower sleep interval to avoid a race in the closing process
        # which can lead to higher latency closing due to sleeping when
        # we have events.
        interval = min(interval, 0.05)
    return (expiration, interval)