• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is time to time polling mechanism  RSS feed

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when browsing through forums i gone through this :

Whenever there is a change in the back-end i want a notification in the front-end.
I thought of using a time to time polling mechanism.

Can anybody please give an idea of what is time to time polling mechanism and how it works ??

Thank you
 
Jeff Storey
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RaviNada,

"Time to time polling" isn't really an industry term, but rather you're more likely to hear it called just "polling" or a "pull" system. Basically, the client would poll the server for changes periodically (i.e. from time to time). For example, say a client is interested in knowing when a stock price changes. The server can either push notifications out to the client (event driven), i.e. the server tells the client when updates are available. Or the client can check with the server periodically to see if any updates exist and pull them when they do.

Depending on your system, one mechanism may be more appropriate than the other. In a polling system, the client only gets updated when it wants to. This may prevent the server from sending a lot of data to the client when the client isn't interested. On the flip side though, the client may not always have up to date data.

Jeff
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"The server can either push notifications out to the client (event driven), i.e. the server tells the client when updates are available"


Jeff Thanks for your reply .


The above requirement can be achieved using Observable and Observer know , or is there any other technique also ??
 
Jeff Storey
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It all basically boils down to the observer pattern as you have suggested, but you're not limited to the java Observer and Observable classes. You could implement your own system that with asynchronous callbacks, use RMI, etc. Really depends on what you need.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes , Thanks a lot
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!