Safer stop/resume for RefreshManager - Printable Version
+- Aria Templates Forums (http://ariatemplates.com/forum)
+-- Forum: Public forums (/forumdisplay.php?fid=3)
+--- Forum: Specifications (/forumdisplay.php?fid=13)
+--- Thread: Safer stop/resume for RefreshManager (/showthread.php?tid=195)
Safer stop/resume for RefreshManager - flongo - 17 March 2014 15:05
Class [aria.templates.RefreshManager][http://www.ariatemplates.com/aria/guide/apps/apidocs/#aria.templates.RefreshManager] is responsible of refresh operations. It provides an API to stop and resume them. The code behind these methods just updates a counter so that, when the resume is called as many times as the stop method has been called before, refresh operations are executed.
This implementation is error-prone: if the resume is called erroneously called multiple time, it is likely that some errors occurs because refresh operations restart too early, when the entities that stopped it are not yet ready.
The stop/resume mechanism should be improved.
3. Technical solution
Here is the new signature suggested for the methods