java - GAE - Should I chain asynchronous callbacks? -


i'm new using asynchronous callbacks , i'm not sure if i'm planning out appropriate way go doing things. i'm working google app engine along google web toolkit, , provide simple way perform asynchronous callback methods rpc service. i've got basic asynchronous callbacks working fine, i'm looking little more complicated. want set things part of web app that's available user loaded first there's user use quick possible. next available parts loaded , on. might want more complicated , load in order described unless user clicks else, load part first.

the way i'm thinking doing using asynchronous function calls in gae , gwt , on success of 1 call start next one. should work, more parts need loaded more code becomes bit spaghetti. there better way make , organize these asynchronous calls? google provide better method organize don't know about? also, going down wrong road , should doing different? thank much!

no, rpc calls not way load parts of site.

see instead ... https://developers.google.com/web-toolkit/doc/latest/devguidecodesplitting

per example, suppose wanted split out window.alert call separate code download:

button b = new button("click me", new clickhandler() {

  public void onclick(clickevent event) {     gwt.runasync(new runasynccallback() {       public void onfailure(throwable caught) {         window.alert("code download failed");       }        public void onsuccess() {         window.alert("hello, ajax");       }     });   } }); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -