Learner
Learner

Reputation: 1313

How to use GWT RPC async calls as GWT.runAsync RunAsyncCallback split points?

We are very heavy users of GWT RPC and have wrapped it into a framework that makes it significantly more usable. The application is big and is going to get even bigger, so we need to think more about the split points. One very natural way of having split points for our app is around the GWT RPC calls. They are already asynchronous and safe from that perspective and it does separate areas of our application quite well.

The question is whether there is a way to apply GWT split points generically around GWT RPC calls without having developers explicitly code in double async calls - specifically we do NOT want to do this:

GWT.runAsync(new RunAsyncCallback() {
  public void onFailure(Throwable t) {
    ...
  }
  public void onSuccess() {
    ...our own GWT RPC *framework* method call(... new AsyncCallback<...>() {
      public void onFailure(Throwable t) {
        ...
      }

      public void onSuccess(...) {
        ...
      }
    });
  }
});

We tried adding the GWT.runAsync wrapping inside our framework (doable for all GWT RPC calls), but that only splits off the little body of the framework method that is generic and always needed anyway - GWT (2.7.0) cannot determine (by compile time static analysis) that this can and should apply to all calls to this method).

Is there a way to achieve this without having developers have to specifically wrap their code additionally in runAsync?

Thanks!

Upvotes: 2

Views: 659

Answers (0)

Related Questions