Hi,
Say i have a server process which listens for some changes in database.
When a change occurs i want to refresh my page in browser by notyfinig it.
I do not want to refresh my page i.e. every 5 seconds, i just want to refresh it ONLY on server change just like desktop applications do.
The problem is that refreshing evry n seconds has to much impact on my web server. The refresh action should be taken only when something really happens that makes sense
Is it possible ?
greets, peter
Take a look at this, I think it's exactly what you need:http://encosia.com/index.php/2007/07/25/display-data-updates-in-real-time-with-ajax/
It does poll the server, but allows you to use a very light weight polling call and only trigger a partial postback if it's needed.
I had to do this in an application I wrote recently. What I did was basically the same method as above, but I used web services instead of doing a full postback.It seemed to work quickly enough to manage, and kept all the code nice and separated. You just call the webservice and have it check the database for new data, and update accordingly.
No comments:
Post a Comment