Fix callback group implementation to match the documentation.

The contract for a CallbackGroup is that all callbacks are invoked
exactly once (either success or failure).
  + Failures are invoked immediately
  + Success wait until all callbacks are complete

In certain situations, like caches, callbacks may be invoked immediately
if the result is known. Depending on how the other callbacks completed,
this could have caused the callback to be invoked more than once; once for
success and again for the subsequently added callback success or failure.

Change-Id: If4c5d99bff6dc916826572ddb6fdff914536a01d
This commit is contained in:
Colby Ranger
2013-06-24 16:45:27 -07:00
parent a2b71c85b1
commit 332e67cd05
8 changed files with 106 additions and 78 deletions

View File

@@ -386,7 +386,7 @@ public abstract class PatchScreen extends Screen implements
}
}));
PatchUtil.DETAIL_SVC.patchScript(patchKey, idSideA, idSideB,
settingsPanel.getValue(), cb.addGwtjsonrpc(
settingsPanel.getValue(), cb.addFinal(
new ScreenLoadCallback<PatchScript>(this) {
@Override
protected void preDisplay(final PatchScript result) {