I slowly dig around and study redis in my free time, and I'm interested in the options available to create a “listener” for a site that subscribes to the channel, and refreshes the web page as it receives messages.
Now, from my old days of actioncript and the current work of javascript, I am well acquainted with the concept of listeners, given these two languages. However, my server-programming-fu really only extends to PHP, a little rails, a bit of python and a pseudo node.js (I am a pretty experienced javascript guy and understand that node.js).
Since my main skill set is in php, I wonder if it is even possible to make a permanent connection / socket with php and thereby create a listener in PHP?
Since I assume that this is actually not possible (or is it the equivalent of fixing a windshield crack with a hammer), what are some server-side options? Is it possible to simply create a javascript listener that uses a persistent connection to the redis server (currently on the local host). Is Socket.io something I should look at?
Any insight for a beginner redis would be greatly appreciated.
edit I found a great post here How to use redis PUBLISH / SUBSCRIBE with nodejs to notify clients when data values change? that partially answers my question.
Is there a method other than node.js that does the same? I am fine with completely dropping php and trying something new for this project. It is personal anyway.
source share