Been using PHP for quite some time now and I was wondering what this whole "message queue" is all about. Let's take facebook for example. I can update my status but then I have to show that status updates to all my friends (let's say I have 3000 followers). Even more work if there are comments and they have to be notified to all friends who left a comment via email. With the example I've seen, it appears that all a message queue does is take the "message" (my status update) and puts it into some temporary space (filesystem or DB table). I then have a cron job that pulls it out and updates my table.
With that said, how do I go about manipulating that data? I guess I'm getting confused as to how this would really help me. How do I translate the following function into a message queue and then schedule for function to run at a later time?
1 - Update my status 2 - Now publish it across my page and all my friends. 3 - If comment is left, now email that latest comment to those who "subscribe" to that comment.
My question is, how do I manipulate that data? Do I just insert the "comment" then have a "job" that pulls that comment out and plug it into a function that processes it?
Here's an example I plan on looking into.
http://www.freeopenbook.com/php-hacks/phphks-CHP-5-SECT-18.html
Thanks in advance.