Thursday, May 9, 2013

How to make asynchronous calls from the GWT server to a 3rd party.

My GWT client makes an asychronous RPC call to the server side servlet and sometime later gets a call back with the result.  That sometime later is determined by the amount of time it takes is dependent on the actions of the servlet and the entire mechanism is well understood.  

Beyond this, what I need to do is to call a 3rd party application from my servlet in order to fulfill the request the client has originally made of the servlet.  The 3rd party also has an asynchronous call interface, so after making the call, I have to await a call back to the servlet before I can finally response to the client.  The question is, how do I "park" the thread in the servlet that the original RPC request arrived upon (i.e. the one running the servlet method specified in the RPC call) while waiting for the 3rd party callback?  And how can I pick it up again later when the 3rd party callback arrives so I can finally return the response to the client?

Any ideas?

Thanks
Simon

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment