I can see that allowing the above would still not solve the async,
single threaded nature of ajax calls.
But there must be some way to reuse the Service interface on the
client.
Perhaps compiling a call to a Service interface could be implemented
in JavaScript like this:
Java:
StockPrice[] prices = stockPriceSvc.getPrices();
Window.alert("first bit done");
try {
MyResult result = anotherService.doSomehingWithPrices(prices);
Window.alert("all done" + result);
}
catch (RemoteException re) {
Window.alert("Oops " + re.getMessage());
}
JavaScript:
function firstBit() {
callAsync("stockPrice", secondBit);
}
function secondBit(var prices) {
alert("first bit done");
try {
callAsync("anotherService", thirdBit);
}
catch (e) {
alert("Opps + e.description);
}
}
function thirdBit(var result) {
alert("all done" + result);
}
This would give the appearance of multi-threaded code.
I am interested to hear why this would never work in practice ;)
Cheers,
JD
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---