def METHOD_NAME(self):
    with self._condition:
        while not self._responses and self._open:
            self._condition.wait()
        if self._responses:
            return self._responses.popleft()
        else:
            raise StopIteration()