code: def consume(self, **kwargs):
          
          kwargs.setdefault('block', True)
          try:
              while True:
                  msg = self.get(**kwargs)
                  if msg is None:
                      break
                  yield msg
          except KeyboardInterrupt:
              print; return
docs: Return a generator that yields whenever a message is waiting in the
          queue. Will block otherwise. Example:
          
          >>> for msg in queue.consume(timeout=1):
          ...     print msg
          my message
          another message
          
          :param kwargs: any arguments that :meth:`~hotqueue.HotQueue.get` can
              accept (:attr:`block` will default to ``True`` if not given)