Muhannad schrieb: > I'm working on GWT RPC and I have a problem with the method invocation > order; I have to invoke two methods m1() and m2() by this order (cause > m2 depends on the results of m1) but, I don't know why, the method > m2() is invoked before m1() even if I wrote: m1(); m2(); > > So, does RPC Asynchronous Callback implies that the methods could be > invoked out of order? If so, please how could I workaround that?
In the last two week, there are at least two threads with this topic AFAIR, so you might check them out for more answers. In short, the "Asynchronous" in "RFC Asynchronous" is there for a reason, so a m1(); m2(); will never work as you indend. You have to chain the calls, i.e. place m2() into the onSuccess-method of m1(). That the second calls always arrive before the first one might be a coincident, but technically m1 and m2 are two HTTP-Requests that are sent more or less simultaneously, so in dependence of the time they need to arrive at the server the order can't be ensured. If the amount of parameters of the first method are significantly bigger than the one of the second method this might be the reason for the order of execution you experience. The time to transfer the serialized data is longer. Be happy about that otherwise, you might come up with that problem at a later point of time where changes are harder to do. Regards, Lothar --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
