def event_with_tag(self, tag):
        with self._condition:
            while True:
                if self._events[tag]:
                    return self._events[tag].pop(0)
                else:
                    self._condition.wait()