Smartupdater

  |   Home  |   Basic  |   Stop / Restart  |   Programmable Timeout  |   Smart Updating   |   Remote Control  |   Download  |   Blog

Smartupdater-3.0.beta is released. Please visit http://www.eslinstructor.net/smartupdater3/


Smart Updating  /  Multiplying Interval

Time on server:
Smartpdater State:
Smartpdater Timeout:

     

$("#example1").smartupdater({
   url : 'getmin.php',
   multiplier: 2,
   minTimeout: 1000 // 1 second
   }, function (data) {
     $("#example1").html(data);
   }
);

$("#example1").smartupdaterStop();

$("#example1").smartupdaterRestart();

$("#example1")[0].smartupdaterStatus.state

$("#example1")[0].smartupdaterStatus.timeout

Smart Updating

As returned data is the same within several polling cycles, Smartupdater doesn't update the data in browser. Click "Clear data" button and see, that view is updated only once in a minute, not on every cycle.

Multiplying Interval

Option multiplier" is set to "2" (it's default, I added the line only for demo purpose), so each time server returns not modified data, Smartupdater doubles it's polling period (in this example minTimeout is set 1 sec). Within 1 minute it is: 2 sec, 4 sec, 8 sec, 16 sec, 32 sec. Then data is changed and Smartupdater set polling period to "minTimeout".

"multiplier" can be set not only as integer, but as a fractional number, say, 1.25 or 2.5

To disable this feature, set "multiplier : 1"



©2010 Vadim Kiryukhin