Hi all.
I am going to be creating a notification center which will manage
notifications between various objects in my application. I want the
notifications to be pretty much real time (less than 15 seconds delay). For
example, if object A (someone on computer A) does something that object B
(someone else on computer B) is "observing," I want object B to be notified
about it. I'm not really looking to use sockets on the backend (but would
consider it). Right now I'm talking about the front-end implementation.
My initial thought for getting notifications would be to add a periodical
event that checks for updates. Something like so...
var req = new Request.JSON({
method: 'get',
url: 'notifications.php?id=123456',
link: 'chain',
onComplete: function () {
// Do whatever
}
});
// Check every 10 seconds
req.send.periodical(10000);
Is this a good way to manage these notifications? What are the pros and cons
of this? I noticed that Facebook has recently started doing live updates to
feeds, but not really sure how they accomplish it.
Thanks in advance!
~Philip
--
http://lonestarlightandsound.com/