Tuesday, January 21, 2014

How to build system to check the incoming messages in GWT?

Ok, I got a message system, user can send message to each other at any time. The message icon is in the header. I want to program so that when person A sends a message to person B, then B can be able to see the message in the header immediately & automatically without needing to refresh the page.

How does that system work?

I think there some solutions here,

-Solution1: we program so that each active page will check the message every 5 minutes. This is not too smart since if there's no message, the server still receives the call every 5 min. Imagine there is a million users & if each user opens the page & lives the page for the whole day then server will receive too many unnecessary calls.

-Solution2: Do some sort of global variable that check the incoming message. When A sends message to B, the global variable will be changed, & we needs to do something so that that variable can check all the active pages that user B is opening & the system sends the reminder to all those pages. I am not sure if this is the right way to do.

Can you find a better solution?

Does anyone know what is the wright way to build this system?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate