title: GWT Callbacks Implementation
body: <p>I'm maintaining software that contains a bunch of user groups. When an Admin clicks "Remove" on a user of a group, two things should happen:</p>
  
  <ol>
  <li>delete the group member (involves updating cache, db, etc.)</li>
  <li>reload a list of group members (the user sees this list when he/she deletes a user)</li>
  </ol>
  
  <p>It turns out that #2 finishes before #1 - race condition. As a result, I want to add a callback so that #2 does not execute until #1 is successful.</p>
  
  <p>Is this code acceptable for GWT to ensure #2 occurs before #1?</p>
  
  <pre><code> doTask1();
  
   GWT.runAsync(new RunAsyncCallback()
   {
     public void onFailure(final Throwable reason)
     {
     }
  
     public void onSuccess()
     {                       
       doTask2();
     }
   });
  </code></pre>