jamie.nicholson
4 Sep 2008, 12:49 AM
To put my discussion in context I've just read the following thread, it explains how to use Javascript/ExtJS to periodically reload datastores.
http://extjs.com/forum/showthread.php?p=35347#post35347
This is an accepted method of refreshing datastores however it sounds very resource intensive/wasteful if you have a large number of datastores and users.
So for big applications I had different idea's inspired by Saki's blogs - big application and inter component communication, my idea is as follows
Inter Client Communication - it goes a liittle something like this
->Clients updates the server via AJAX or form submission
->Server keeps a inter client event queue - each event has an expiry time
->Client polls the inter client event queue - interval less than event expiry time
->Client then fires the event and listener functions are run if they've been setup for that client.
->All clients are happy and can update each other.
The advantage with this is that the client only refreshes or does what it needs to and providing the event queue is small it shouldn't be a huge load on the server. Although executing all the events woudl have a little overhead :-?
Someone might have done this already or have some thoughts on it, I'd appreciate your ideas here. Providing nothing better is out there I'll start on an example and add it to the thread, if it proves to be a good thing.
http://extjs.com/forum/showthread.php?p=35347#post35347
This is an accepted method of refreshing datastores however it sounds very resource intensive/wasteful if you have a large number of datastores and users.
So for big applications I had different idea's inspired by Saki's blogs - big application and inter component communication, my idea is as follows
Inter Client Communication - it goes a liittle something like this
->Clients updates the server via AJAX or form submission
->Server keeps a inter client event queue - each event has an expiry time
->Client polls the inter client event queue - interval less than event expiry time
->Client then fires the event and listener functions are run if they've been setup for that client.
->All clients are happy and can update each other.
The advantage with this is that the client only refreshes or does what it needs to and providing the event queue is small it shouldn't be a huge load on the server. Although executing all the events woudl have a little overhead :-?
Someone might have done this already or have some thoughts on it, I'd appreciate your ideas here. Providing nothing better is out there I'll start on an example and add it to the thread, if it proves to be a good thing.