Please help me with your suggestions. I'm playing with Redis pub/sub via redis-py as a possible method to reload a component in a page instead of polling.
In its simplest form the idea is: 1) create pubsub object 2) subscribe it to one or more channels (just one in this case) 3) create listen object to listen to subscribed channels 4) listen object calls .next() <--- stuck here 5) new message published to channel triggers component reload Everything works great on at a python CLI however I cannot seem to figure out one crucial detail. When I start the listener object to check for new messages it is a blocking call so it prevents the page from completely loading while waiting for a new message on the channel it is subscribed to. I tried putting listener.next() at the end of my view but it prevents my page from working properly as it just blocks waiting for a new message. A new message allows the page to complete loading but that defeats the purpose. How can I completely load my page and then start listening to Redis' pubsub for new messages? Your thoughts are most appreciated. -David