title: redis python psubscribe to event with callback, without calling .listen()
body: <p>I'm trying to subscribe to keyspace event in redis using python. I hope to NOT use the for-loop with <code>.listen()</code> after calling <code>.psubscribe()</code>. Is this possible?</p>
  
  <p>I have enabled all keyspace events with <code>KEA</code>.</p>
  
  <pre><code>def subscribe(self, key, handler):
  
          # this function never gets called, if I don't add the for-loop with listen() below
          def event_handler(msg):
              print('Handler', msg)
  
          redis_server = StrictRedis(host='localhost', port=6379, db=0)
          pubsub = redis_server.pubsub()
          subscribe_key = '*'
          pubsub.psubscribe(**{subscribe_key: event_handler})
  
          # without the following for-loop with listen, the callback never fires. I hope to get rid of this.
          for item in pubsub.listen():
              pass
  </code></pre>