Post Reply 
Author Safer stop/resume for RefreshManager
AT core team member

Find all posts by this user
Quote this message in a reply
Default  17 March 2014 15:05
1. Requirements

Class [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

* Puts the Refresh Manager in "STOPPED" state, effectively causing all template/section/widget refreshes to be
* queued instead of being fired immediately.
[b] * @return {String} Return a unique id for this stop operation. It will have to be used in order to resume it
[/b] */
stop : function () {


* Triggers the minimal set of refreshes which covers all the templates/sections/widgets found in the queue.
* Puts the Refresh Manager back in "RUNNING" state.
* @param {String} id Identifier of the corresponding stop operation
resume : function (id) {
  • Class aria.templates.RefreshManager should keep an array of identifiers corresponding to different calls to the stop method.
  • When the resume method is called with the wrong indentifier, an error should be raised.

4. History

17/03/20104 Spec creation - Francesco Longo
(This post was last modified: 17 March 2014 15:05 by flongo.)
Post Reply