title: Python-Kafka: Keep polling topic infinitely
body: <p>I am using python-kafka to listen to a kafka topic and use that the records. I want to keep it polling infinitely without any exit. This is my code below:</p>
  <pre><code>def test():
      consumer = KafkaConsumer('abc', 'localhost:9092', auto_offset_reset='earliest')
      for msg in consumer:
          print(msg.value)
  </code></pre>
  <p>This code just reads the data and exits directly. Is there a way to keep listening to topics even if message is not pushed to it?</p>
  <p>Any relevant example where the topic is continuously monitored is also great for me.</p>