code: def wait(self):
          
          if not self._patterns:
              raise RuntimeError('Listener has nothing to capture')
  
          while 1:
              msg = self._queue.get(block=True)
  
              if any(map(lambda p: filtering.match_all(msg, p), self._patterns)):
                  return msg
docs: Block until a matched message appears.