Page 1 of 1

What do you suggest?

Posted: Thu Sep 20, 2007 10:21 am
by silvercover
I have to make a website for local restaurants to let people order foods online. I decided to make this system real-time. In other words, i want it to notify restaurant kitchen about new orders synchronously (at least almost). What i have in my mind is to make a program ( we call it messenger ) to check server periodically with default or custom intervals. for example it should check database for new orders every 30 seconds. When i look at this solution, it comes to my mind that there must be better solutions which i am not aware of! so i came here to ask you guys what is the best solution for this?

My ideal solution is to have notifying mechanism like what we see in Instant messenger like Yahoo Messenger. As you know when you receive new email, YIM notifies you by showing a message and this not based on client side checking system that i mentioned in first paragraph.

Thanks in advance.

Posted: Thu Sep 20, 2007 9:44 pm
by califdon
Wouldn't you just add the notification code to the application that updates the database? I don't see why you would need a timed database access.

Posted: Fri Sep 21, 2007 12:22 am
by Christopher
Comet

Posted: Fri Sep 21, 2007 3:57 am
by Maugrim_The_Reaper
What arborint said ;).

Comet is a server-push model. Once the initial HTTP response is received by the client (using AJAX), the connection is maintained to push new data immediately to the client. So long as the number of maintained connections is not too many it scales fine - might want to run it from a separate subdomain since most browsers/clients only allow a limited number of connection per domain.

Posted: Fri Sep 21, 2007 11:59 am
by Christopher
Hey silvercover, there is a PHP Comet demo here, but I clicked on the demo link and it did not work. Why don't you get that demo code working and post the fixed code and your thoughts here. I think other members would be interested in that.

Posted: Fri Sep 21, 2007 1:18 pm
by silvercover
Thank you guys for your great info. I am studying Comet model as much as i can.

@arborint,

Let me see that source and examine it. :)

@califdon,

I know about this, but imagine the situation that you forced to use instant messaging model. i also thought about email to fax, email to SMS and similar methods including sending simple email message. The most effective solution for our needs is instant messaging. On the other side we
want to bring new experience for customers and let them keep in touch with restaurant and track their orders via that Messenger i mentioned.

Posted: Fri Sep 21, 2007 2:31 pm
by Christopher
silvercover wrote:Let me see that source and examine it. :)
Great. I just don't have time right now to look into why it wasn't working (there is a chat demo on that page too). If you can figure out the problem, but narrow it down a little, post the code here and we can pitch in to get a working demo. I think that would benefit everyone here interested in this subject.