You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
I'm having issue with the "start()" which is suppose to stop() and start() so that the new options can be updated as you suggested.
I simplified my code to run some experiment and here is what I did... Essentially, I start the poller and then after 10 sec re-start the poller (suppose to the change the time out, but just keep it the same for now).... do the restart twice...
varPolling=Polling||{};Polling.model=newBackbone.Model();Polling.model.url='url.example.com';Polling.poller=PollingManager.getPoller(Polling.model,{delay: 10000,fetch: function(){console.log('pre-fetch @'+newDate());}}).start();Polling.restart_count=0;Polling.restart_poller=function(){Polling.restart_count++;console.log("Restart the poller: count = "+Polling.restart_count);Polling.poller=PollingManager.getPoller(Polling.model,{delay: 10000}).start();if(Polling.restart_count>=2){console.log("No more restart the poller");window.clearTimeout(Polling.timer);}};Polling.timer=window.setInterval('Polling.restart_poller()',10000);
The expected behavior is that after each re-start, the poller should just continue to poll at every 10 sec.. since I did not change anything....
But the result is different, after the 1st re-start, I start to see that there are two back-2-back pollings every 10 sec
After the 2nd re-start, there are three back-to-back polls for every 10 sec..
Seems that the original scheduled pollings are not cancelled but just keep adding to it...
Here is what I see from the console log
pre-fetch @Wed May 16 2012 23:51:58 GMT-0400 (Eastern Daylight Time)
<< These two lines I can understand since the original poll finished and new one starts also>>>
Restart the poller: count = 1
pre-fetch @Wed May 16 2012 23:52:08 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:09 GMT-0400 (Eastern Daylight Time)
<< We should see only two lines; but there are three!!>>>
Restart the poller: count = 2
pre-fetch @Wed May 16 2012 23:52:18 GMT-0400 (Eastern Daylight Time)
No more restart the poller
pre-fetch @Wed May 16 2012 23:52:18 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:19 GMT-0400 (Eastern Daylight Time)
<< We should see only one poll but there are three!!>>>
pre-fetch @Wed May 16 2012 23:52:28 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:29 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:29 GMT-0400 (Eastern Daylight Time)
<< We should see only one poll but there are three!!>>>
pre-fetch @Wed May 16 2012 23:52:39 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:39 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:39 GMT-0400 (Eastern Daylight Time)
The text was updated successfully, but these errors were encountered:
I'm having issue with the "start()" which is suppose to stop() and start() so that the new options can be updated as you suggested.
I simplified my code to run some experiment and here is what I did... Essentially, I start the poller and then after 10 sec re-start the poller (suppose to the change the time out, but just keep it the same for now).... do the restart twice...
The expected behavior is that after each re-start, the poller should just continue to poll at every 10 sec.. since I did not change anything....
But the result is different, after the 1st re-start, I start to see that there are two back-2-back pollings every 10 sec
After the 2nd re-start, there are three back-to-back polls for every 10 sec..
Seems that the original scheduled pollings are not cancelled but just keep adding to it...
Here is what I see from the console log
pre-fetch @Wed May 16 2012 23:51:58 GMT-0400 (Eastern Daylight Time)
<< These two lines I can understand since the original poll finished and new one starts also>>>
Restart the poller: count = 1
pre-fetch @Wed May 16 2012 23:52:08 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:09 GMT-0400 (Eastern Daylight Time)
<< We should see only two lines; but there are three!!>>>
Restart the poller: count = 2
pre-fetch @Wed May 16 2012 23:52:18 GMT-0400 (Eastern Daylight Time)
No more restart the poller
pre-fetch @Wed May 16 2012 23:52:18 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:19 GMT-0400 (Eastern Daylight Time)
<< We should see only one poll but there are three!!>>>
pre-fetch @Wed May 16 2012 23:52:28 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:29 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:29 GMT-0400 (Eastern Daylight Time)
<< We should see only one poll but there are three!!>>>
pre-fetch @Wed May 16 2012 23:52:39 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:39 GMT-0400 (Eastern Daylight Time)
pre-fetch @Wed May 16 2012 23:52:39 GMT-0400 (Eastern Daylight Time)
The text was updated successfully, but these errors were encountered: